| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240206104540AddTableUserReport
- */
- class M240206104540AddTableUserReport extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = "
- CREATE TABLE `qimall_user_report` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL COMMENT 'Mall Id',
- `user_id` int(10) NOT NULL COMMENT '会员ID',
- `title` varchar(255) NOT NULL COMMENT '举报标题',
- `content` longtext COMMENT '举报内容',
- `created_at` int(10) DEFAULT '0',
- `updated_at` int(10) DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `mall_id` (`mall_id`),
- KEY `user_id` (`user_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户举报表'";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240206104540AddTableUserReport cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240206104540AddTableUserReport cannot be reverted.\n";
- return false;
- }
- */
- }
|