2016-01-02 19:13:18 +05:30
|
|
|
<?php
|
|
|
|
|
2016-01-03 05:48:37 +05:30
|
|
|
use console\db\Migration;
|
2016-01-02 19:13:18 +05:30
|
|
|
|
2016-01-03 05:48:37 +05:30
|
|
|
class m130524_201442_init extends Migration {
|
2016-01-02 19:13:18 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public function up(): void {
|
2016-01-03 05:48:37 +05:30
|
|
|
$this->createTable('{{%accounts}}', [
|
2016-01-02 19:13:18 +05:30
|
|
|
'id' => $this->primaryKey(),
|
2016-01-03 05:48:37 +05:30
|
|
|
'uuid' => $this->string(36)->notNull(),
|
|
|
|
'email' => $this->string()->notNull()->unique(),
|
2016-01-02 19:13:18 +05:30
|
|
|
'password_hash' => $this->string()->notNull(),
|
2016-01-03 05:48:37 +05:30
|
|
|
'password_hash_strategy' => $this->smallInteger()->notNull(),
|
2016-01-02 19:13:18 +05:30
|
|
|
'password_reset_token' => $this->string()->unique(),
|
2016-01-03 05:48:37 +05:30
|
|
|
'status' => $this->smallInteger()->notNull()->defaultValue(0),
|
|
|
|
'auth_key' => $this->string(32)->notNull(),
|
2016-01-02 19:13:18 +05:30
|
|
|
'created_at' => $this->integer()->notNull(),
|
|
|
|
'updated_at' => $this->integer()->notNull(),
|
2016-01-03 05:48:37 +05:30
|
|
|
], $this->tableOptions);
|
2016-01-02 19:13:18 +05:30
|
|
|
}
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public function down(): void {
|
2016-01-03 05:48:37 +05:30
|
|
|
$this->dropTable('{{%accounts}}');
|
2016-01-02 19:13:18 +05:30
|
|
|
}
|
2016-01-03 05:48:37 +05:30
|
|
|
|
2016-01-02 19:13:18 +05:30
|
|
|
}
|