mysqldump saves views as tables

0

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?

    
asked by Paco S 30.10.2018 в 23:28
source

1 answer

0

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' */;
    
answered by 01.11.2018 / 14:58
source