Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class m200823_094104_create_auth_client_table extends Migration |
||
9 | { |
||
10 | /** |
||
11 | * {@inheritdoc} |
||
12 | */ |
||
13 | public function safeUp() |
||
14 | { |
||
15 | $this->createTable('{{%auth_client}}', [ |
||
16 | 'id' => $this->primaryKey(), |
||
17 | 'user_id' => $this->integer()->notNull(), |
||
18 | 'type' => $this->tinyInteger()->notNull(), |
||
19 | 'client_id' => $this->string()->notNull(), |
||
20 | 'client_username' => $this->string(), |
||
21 | 'data' => $this->text(), |
||
22 | 'status' => $this->tinyInteger()->notNull(), |
||
23 | 'created_at' => $this->timestamp()->defaultValue(null), |
||
24 | 'updated_at' => $this->timestamp()->defaultValue(null), |
||
25 | ]); |
||
26 | |||
27 | $this->createIndex('login_user_id_type', '{{%auth_client}}', ['user_id', 'type'], true); |
||
28 | $this->createIndex('login_type_client_id', '{{%auth_client}}', ['type', 'client_id'], true); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function safeDown() |
||
37 | } |
||
38 | } |
||
39 |