You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m191112_015939_create_table_delivery
  5. */
  6. class m191112_015939_create_table_delivery extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function up()
  12. {
  13. $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="物流表"';
  14. $this->createTable('ats_delivery', [
  15. 'id' => $this->primaryKey(),
  16. 'order_id'=>$this->integer(11)->defaultValue(null)->comment('订单id'),
  17. 'shipping_name'=>$this->string(50)->defaultValue(null)->comment('货流名称'),
  18. 'shipping_id'=>$this->string(10)->defaultValue(null)->comment('运货单位'),
  19. 'type'=>$this->tinyInteger(1)->defaultValue(0)->comment('类型'),
  20. 'goods'=>$this->text()->comment('商品'),
  21. 'status'=>$this->tinyInteger(1)->defaultValue(0)->comment('状态'),
  22. 'decription'=>$this->text()->comment('描述'),
  23. 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
  24. 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
  25. ],$tableOptions);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function down()
  31. {
  32. $this->dropTable('ats_delivery');
  33. return true;
  34. }
  35. }