Blame view

console/migrations/m220412_144550_create_product_table.php 985 Bytes
8e73da4f   Volodymyr   product models an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  <?php
  
  use yii\db\Migration;
  
  /**
   * Handles the creation of table `product`.
   */
  class m220412_144550_create_product_table extends Migration
  {
      /**
       * @inheritdoc
       */
      public function up()
      {
          $this->createTable('product', [
              'id' => $this->primaryKey(),
              'status'             => $this->boolean(),
              'sort'             => $this->smallInteger(),
              'sku'               =>$this->string(255),
96c82e64   Volodymyr   product admin price
20
              'price'               =>$this->string(255),
8e73da4f   Volodymyr   product models an...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
              'image_id'        => $this->integer(),
          ]);
          $this->addForeignKey(
              'fk-product-image_id',
              'product',
              'image_id',
              'ImageManager',
              'id',
              'CASCADE'
          );
      }
  
      /**
       * @inheritdoc
       */
      public function down()
      {
          $this->dropForeignKey(
              'fk-product-image_id',
              'product'
          );
          $this->dropTable('product');
      }
  }