Browse Source

refactor:商品数据表修改排序字段

antshop
linyaostalker 5 years ago
parent
commit
798ae3cdcf
  1. 22
      backend/modules/goods/migrations/m191211_092335_update_column_sort_order_in_table_atg_goods.php

22
backend/modules/goods/migrations/m191211_092335_update_column_sort_order_in_table_atg_goods.php

@ -0,0 +1,22 @@
<?php
use yii\db\Migration;
/**
* Class m191211_092335_update_column_sort_order_in_table_atg_goods
*/
class m191211_092335_update_column_sort_order_in_table_atg_goods extends Migration
{
public function up()
{
$this->dropColumn('atg_goods', 'sort_order');
$this->addColumn('atg_goods', 'sort_order', $this->smallInteger(3)->defaultValue("999")->comment('排序'));
}
public function down()
{
$this->dropColumn('atg_goods', 'sort_order');
$this->addColumn('atg_goods', 'sort_order', $this->smallInteger(3)->defaultValue(null)->comment('排序'));
return true;
}
}
Loading…
Cancel
Save