]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
миграция сброса индекса
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 14 Feb 2025 12:16:30 +0000 (15:16 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 14 Feb 2025 12:16:30 +0000 (15:16 +0300)
erp24/migrations/m250214_113003_alter_table_drop_unique_product_id_in_prices.php [new file with mode: 0755]

diff --git a/erp24/migrations/m250214_113003_alter_table_drop_unique_product_id_in_prices.php b/erp24/migrations/m250214_113003_alter_table_drop_unique_product_id_in_prices.php
new file mode 100755 (executable)
index 0000000..b41335e
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m250214_113003_alter_table_drop_unique_product_id_in_prices
+ */
+class m250214_113003_alter_table_drop_unique_product_id_in_prices extends Migration
+{
+    const TABLE_NAME = 'erp24.prices';
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+
+        $this->dropIndex('idx_463248_primary', self::TABLE_NAME);
+        $this->dropIndex('idx_463248_product_id', self::TABLE_NAME);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->createIndex('idx_463248_primary', self::TABLE_NAME, 'product_id');
+        $this->createIndex('idx_463248_product_id', self::TABLE_NAME, 'product_id', true);
+    }
+}