在我在 MySQL Workbench 中创建的数据库模型中,我定义了一个视图。Menu -> Database -> Forward Engineer
当我现在从图表(或)生成 SQL 时Ctrl + G
,将为我的视图创建此代码:
-- -----------------------------------------------------
-- Placeholder table for view `myview`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `myview` (...table columns...);
SHOW WARNINGS;
-- -----------------------------------------------------
-- View `myview`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `myview` ;
SHOW WARNINGS;
DROP TABLE IF EXISTS `myview`;
SHOW WARNINGS;
DELIMITER $$
CREATE OR REPLACE VIEW `myview` AS
...view definition...
$$
DELIMITER ;
;
SHOW WARNINGS;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
为什么要创建这个占位符表?
谢谢