From: fomichev Date: Fri, 14 Feb 2025 10:48:44 +0000 (+0300) Subject: Миграция X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=ac0a409050dabf4d98fc2d4d045f109ad10823c7;p=erp24_rep%2Fyii-erp24%2F.git Миграция --- 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; + } + */ +}