m220227_143427_common_notify_member.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use yii\db\Migration;
  3. class m220227_143427_common_notify_member extends Migration
  4. {
  5. public function up()
  6. {
  7. /* 取消外键约束 */
  8. $this->execute('SET foreign_key_checks = 0');
  9. /* 创建表 */
  10. $this->createTable('{{%common_notify_member}}', [
  11. 'id' => "int(10) NOT NULL AUTO_INCREMENT",
  12. 'app_id' => "varchar(50) NULL DEFAULT '' COMMENT '应用id'",
  13. 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
  14. 'store_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '店铺ID'",
  15. 'member_id' => "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员id'",
  16. 'notify_id' => "int(10) NULL DEFAULT '0' COMMENT '消息id'",
  17. 'is_read' => "tinyint(2) NULL DEFAULT '0' COMMENT '是否已读 1已读'",
  18. 'read_member_id' => "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已读用户'",
  19. 'type' => "tinyint(1) NULL DEFAULT '0' COMMENT '消息类型[1:公告;2:提醒;3:信息(私信)'",
  20. 'status' => "tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]'",
  21. 'created_at' => "int(10) NOT NULL DEFAULT '0' COMMENT '创建时间'",
  22. 'updated_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '修改时间'",
  23. 'PRIMARY KEY (`id`)'
  24. ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公用_消息查看时间记录表'");
  25. /* 索引设置 */
  26. /* 表数据 */
  27. /* 设置外键约束 */
  28. $this->execute('SET foreign_key_checks = 1;');
  29. }
  30. public function down()
  31. {
  32. $this->execute('SET foreign_key_checks = 0');
  33. /* 删除表 */
  34. $this->dropTable('{{%common_notify_member}}');
  35. $this->execute('SET foreign_key_checks = 1;');
  36. }
  37. }
粤ICP备19079148号