m181105_193515_create_interview_log_table.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. /**
  5. * Handles the creation of table `{{%interview_log}}`.
  6. */
  7. class m181105_193515_create_interview_log_table extends Migration
  8. {
  9. public $tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=InnoDB';
  10. /**
  11. * @inheritdoc
  12. */
  13. public function up()
  14. {
  15. /**
  16. * 大师
  17. */
  18. $this->createTable('{{%interview_log}}', [
  19. 'id' => Schema::TYPE_PK,
  20. 'interview_id' => Schema::TYPE_INTEGER . "(11) NOT NULL COMMENT '访谈ID'",
  21. 'type' => Schema::TYPE_SMALLINT . "(1) NOT NULL COMMENT '类型'",
  22. 'content' => Schema::TYPE_STRING . "(500) NOT NULL COMMENT '内容'",
  23. 'created_at' => Schema::TYPE_INTEGER . "(11) NOT NULL",
  24. 'updated_at' => Schema::TYPE_INTEGER . "(11) NOT NULL",
  25. 'status' => Schema::TYPE_SMALLINT . "(1) NOT NULL DEFAULT '1' COMMENT '状态'",
  26. ], $this->tableOptions);
  27. }
  28. /**
  29. * @inheritdoc
  30. */
  31. public function down()
  32. {
  33. $this->dropTable('{{%interview_log}}');
  34. }
  35. }