diff --git a/src/migrations/Install.php b/src/migrations/Install.php index 72f08b6..f24b60d 100644 --- a/src/migrations/Install.php +++ b/src/migrations/Install.php @@ -17,10 +17,8 @@ class Install extends Migration */ public function safeUp(): bool { - // Cleanup - $this->_dropTables(); - // Create the webhookgroups table + $this->archiveTableIfExists('{{%webhookgroups}}'); $this->createTable('{{%webhookgroups}}', [ 'id' => $this->primaryKey(), 'name' => $this->string()->notNull(), @@ -30,6 +28,7 @@ public function safeUp(): bool ]); // Create the webhooks table + $this->archiveTableIfExists('{{%webhooks}}'); $this->createTable('{{%webhooks}}', [ 'id' => $this->primaryKey(), 'groupId' => $this->integer()->null(), @@ -52,6 +51,7 @@ public function safeUp(): bool ]); // Create the webhookrequests table + $this->archiveTableIfExists('{{%webhookrequests}}'); $this->createTable('{{%webhookrequests}}', [ 'id' => $this->primaryKey(), 'webhookId' => $this->integer(), @@ -86,15 +86,11 @@ public function safeUp(): bool * @inheritdoc */ public function safeDown(): bool - { - $this->_dropTables(); - return true; - } - - private function _dropTables(): void { $this->dropTableIfExists('{{%webhookrequests}}'); $this->dropTableIfExists('{{%webhooks}}'); $this->dropTableIfExists('{{%webhookgroups}}'); + + return true; } }