| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class m180503_090313_create_app_table extends Migration |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @inheritdoc |
||
| 12 | */ |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | $tableOptions = null; |
||
| 16 | if ($this->db->driverName === 'mysql') { |
||
| 17 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; |
||
| 18 | } |
||
| 19 | $this->createTable('{{%app}}', [ |
||
| 20 | 'id' => $this->primaryKey(), |
||
| 21 | 'app_name' => $this->string(32)->notNull()->comment('App名称'), |
||
| 22 | 'app_description' => $this->string(125)->notNull()->defaultValue('')->comment('App简介'), |
||
| 23 | 'app_key' => $this->char(36)->notNull()->comment('App Key'), |
||
| 24 | 'app_secret' => $this->char(32)->notNull()->comment('App Secret'), |
||
| 25 | 'created_at' => $this->integer()->notNull()->comment('创建时间'), |
||
| 26 | 'updated_at' => $this->integer()->notNull()->comment('更新时间'), |
||
| 27 | 'status' => $this->boolean()->notNull()->defaultValue(1)->comment('状态'), |
||
| 28 | ], $tableOptions); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritdoc |
||
| 33 | */ |
||
| 34 | public function down() |
||
| 37 | } |
||
| 38 | } |
||
| 39 |