--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m250214_090458_add_column_resource_link_to_wiki_article_table
+ */
+class m250214_090458_add_column_resource_link_to_wiki_article_table extends Migration
+{
+ const TABLE_NAME = 'erp24.wiki_article';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ if ($this->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;
+ }
+ */
+}