m220227_143429_member_invoice.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use yii\db\Migration;
  3. class m220227_143429_member_invoice extends Migration
  4. {
  5. public function up()
  6. {
  7. /* 取消外键约束 */
  8. $this->execute('SET foreign_key_checks = 0');
  9. /* 创建表 */
  10. $this->createTable('{{%member_invoice}}', [
  11. 'id' => "int(11) unsigned NOT NULL AUTO_INCREMENT",
  12. 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
  13. 'store_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '店铺ID'",
  14. 'member_id' => "int(11) unsigned NULL DEFAULT '0' COMMENT '用户id'",
  15. 'title' => "varchar(200) NULL DEFAULT '' COMMENT '公司抬头'",
  16. 'duty_paragraph' => "varchar(200) NULL DEFAULT '' COMMENT '公司税号'",
  17. 'opening_bank' => "varchar(255) NULL DEFAULT '' COMMENT '公司开户行'",
  18. 'opening_bank_account' => "varchar(100) NULL DEFAULT '' COMMENT '公司开户行账号'",
  19. 'address' => "varchar(255) NULL DEFAULT '' COMMENT '公司地址'",
  20. 'phone' => "varchar(50) NULL DEFAULT '' COMMENT '公司电话'",
  21. 'remark' => "varchar(255) NULL DEFAULT '' COMMENT '备注'",
  22. 'is_default' => "tinyint(2) unsigned NULL DEFAULT '0' COMMENT '默认'",
  23. 'type' => "tinyint(4) NULL DEFAULT '1' COMMENT '类型 1企业 2个人'",
  24. 'status' => "tinyint(4) NULL DEFAULT '1' COMMENT '状态(-1:已删除,0:禁用,1:正常)'",
  25. 'created_at' => "int(10) unsigned NULL COMMENT '创建时间'",
  26. 'updated_at' => "int(10) unsigned NULL COMMENT '修改时间'",
  27. 'PRIMARY KEY (`id`)'
  28. ], "ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员_发票'");
  29. /* 索引设置 */
  30. /* 表数据 */
  31. /* 设置外键约束 */
  32. $this->execute('SET foreign_key_checks = 1;');
  33. }
  34. public function down()
  35. {
  36. $this->execute('SET foreign_key_checks = 0');
  37. /* 删除表 */
  38. $this->dropTable('{{%member_invoice}}');
  39. $this->execute('SET foreign_key_checks = 1;');
  40. }
  41. }
粤ICP备19079148号