| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class m000000_000000_api_user extends Migration |
||
|
|
|||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @inheritdoc |
||
| 9 | */ |
||
| 10 | public function safeUp() |
||
| 11 | { |
||
| 12 | $this->createTable('user', [ |
||
| 13 | 'id' => $this->primaryKey(), |
||
| 14 | 'email' => $this->string(255)->notNull(), |
||
| 15 | 'username' => $this->string(255)->notNull(), |
||
| 16 | 'password' => $this->string(255)->notNull(), |
||
| 17 | 'verified' => $this->integer()->defaultValue(0), |
||
| 18 | 'otp_secret' => $this->string(600), |
||
| 19 | 'otp_enabled' => $this->integer()->defaultValue(0), |
||
| 20 | 'created_at' => $this->integer(), |
||
| 21 | 'updated_at' => $this->integer() |
||
| 22 | ]); |
||
| 23 | |||
| 24 | $this->createIndex('user__email_unique_index', 'user', ['email'], true); |
||
| 25 | $this->createIndex('user__username_unique_index', 'user', ['username'], true); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritdoc |
||
| 30 | */ |
||
| 31 | public function safeDown() |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.