From 8c9d50f02f29c90adbc7e173f4de83411cd290ae Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Tue, 13 Jun 2023 14:16:36 +0800 Subject: [PATCH] * TRUNCATE TABLE if driver is dm. --- db/dm.sql | 3 +++ module/install/model.php | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 db/dm.sql diff --git a/db/dm.sql b/db/dm.sql new file mode 100644 index 0000000000..dffd231979 --- /dev/null +++ b/db/dm.sql @@ -0,0 +1,3 @@ +TRUNCATE TABLE `zt_pivot`; +TRUNCATE TABLE `zt_chart`; +DELETE FROM `zt_screen` WHERE id IN (1,2,4,6,7,8); diff --git a/module/install/model.php b/module/install/model.php index d1272efb48..fb120cffb2 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -393,6 +393,8 @@ class installModel extends model $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; $tables = explode(';', file_get_contents($dbFile)); + if($this->config->db->driver == 'dm') $tables = array_merge($tables, explode(';', file_get_contents($this->app->getAppRoot() . 'db' . DS . 'dm.sql')); + foreach($tables as $table) { $table = trim($table);