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.

36 lines
1.2 KiB

  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m191119_025607_create_table_supplier
  5. */
  6. class m191119_025607_create_table_supplier 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('antgoods_supplier', [
  15. 'id' => $this->primaryKey(),
  16. 'name'=>$this->string(50)->notNull()->comment('供应商名称'),
  17. 'full_name'=>$this->string(50)->notNull()->comment('供应商全称'),
  18. 'phone'=>$this->string(20)->notNull()->comment('手机号码'),
  19. 'address'=>$this->string(50)->notNull()->comment('地址'),
  20. 'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->comment('是否删除,1为已删除'),
  21. 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
  22. 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
  23. ],$tableOptions);
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function down()
  29. {
  30. $this->dropTable('antgoods_supplier');
  31. return true;
  32. }
  33. }