| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240108112144AddReportTable
- */
- class M240108112144AddReportTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="CREATE TABLE `qimall_report` (
- `id` int(10) NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `from` varchar(64) NOT NULL COMMENT '举报来源',
- `report_id` int(10) NOT NULL COMMENT '举报ID',
- `type` int(10) NOT NULL COMMENT '举报类型',
- `content` varchar(255) NOT NULL COMMENT '额外内容',
- `updated_at` int(10) DEFAULT NULL,
- `created_at` int(10) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `mall_id` (`mall_id`),
- KEY `report_id` (`report_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4;";
- $this->execute($sql);
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240108112144AddReportTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240108112144AddReportTable cannot be reverted.\n";
- return false;
- }
- */
- }
|