From ac0a409050dabf4d98fc2d4d045f109ad10823c7 Mon Sep 17 00:00:00 2001 From: fomichev Date: Fri, 14 Feb 2025 13:48:44 +0300 Subject: [PATCH] =?utf8?q?=D0=9C=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ...mn_resource_link_to_wiki_article_table.php | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 erp24/migrations/m250214_090458_add_column_resource_link_to_wiki_article_table.php diff --git a/erp24/migrations/m250214_090458_add_column_resource_link_to_wiki_article_table.php b/erp24/migrations/m250214_090458_add_column_resource_link_to_wiki_article_table.php new file mode 100644 index 00000000..c58dca32 --- /dev/null +++ b/erp24/migrations/m250214_090458_add_column_resource_link_to_wiki_article_table.php @@ -0,0 +1,58 @@ +db->schema->getTableSchema(self::TABLE_NAME) === null) { + return; + } + + if ($this->db->schema->getTableSchema(self::TABLE_NAME)->getColumn('resource_link') === null) { + $this->addColumn( + self::TABLE_NAME, + 'resource_link', + $this->string()->null()->comment('Ссылка на ресурс для документации'), + ); + } + + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + if ($this->db->schema->getTableSchema(self::TABLE_NAME) === null) { + return; + } + + if ($this->db->schema->getTableSchema(self::TABLE_NAME)->getColumn('resource_link') !== null) { + $this->dropColumn(self::TABLE_NAME, 'resource_link'); + } + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m250214_090458_add_column_resource_link_to_wiki_article_table cannot be reverted.\n"; + + return false; + } + */ +} -- 2.39.5