| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace addons\ShortVideo\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250819013911CreateQimallAddonsShortVideoUserWatch
- */
- class M250819013911CreateQimallAddonsShortVideoUserWatch extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_short_video_user_watch` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `mall_id` int(11) NOT NULL COMMENT '商城id',
- `user_id` int(11) NOT NULL COMMENT '用户id',
- `video_id` int(11) NOT NULL COMMENT '视频id',
- `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态(0:未观看,1:已观看)',
- `created_at` int(11) DEFAULT NULL COMMENT '添加时间',
- `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250819013911CreateQimallAddonsShortVideoUserWatch cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250819013911CreateQimallAddonsShortVideoUserWatch cannot be reverted.\n";
- return false;
- }
- */
- }
|