When doing a DUMP with mysqldump, the views are saved as tables:
CREATE TABLE v_facturas
The correct thing would be CREATE VIEW v_facturas
AS ...
What option should I use to prevent this problem from happening?
When doing a DUMP with mysqldump, the views are saved as tables:
CREATE TABLE v_facturas
The correct thing would be CREATE VIEW v_facturas
AS ...
What option should I use to prevent this problem from happening?
Creating a dump
test sample effectively as a temporary structure (table) from view, which is then removed to create the final view is created:
--
-- Temporary table structure for view 'v_facturas'
--
DROP TABLE IF EXISTS 'v_facturas';
/*!50001 DROP VIEW IF EXISTS 'v_facturas'*/;
/*!50001 CREATE TABLE 'v_facturas' (
'id' tinyint NOT NULL
) ENGINE=MyISAM */;
--
-- Table structure for table 'facturas'
--
DROP TABLE IF EXISTS 'facturas';
CREATE TABLE 'facturas' (
'id' bigint(20) unsigned NOT NULL AUTO_INCREMENT,
UNIQUE KEY 'id' ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Final view structure for view 'v_facturas'
--
/*!50001 DROP TABLE IF EXISTS 'v_facturas'*/;
/*!50001 DROP VIEW IF EXISTS 'v_facturas'*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50001 VIEW 'v_facturas' AS select 'facturas'.'id' AS 'id' from 'facturas' */;