Первичное портирование логики сервера авторизации с PhalconPHP на Yii2

This commit is contained in:
ErickSkrauch
2016-08-21 02:21:39 +03:00
parent d0fcc8cd6f
commit b57b015f66
24 changed files with 573 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
<?php
use console\db\Migration;
class m160819_211139_minecraft_access_tokens extends Migration {
public function safeUp() {
$this->createTable('{{%minecraft_access_keys}}', [
'access_token' => $this->string(36)->notNull(),
'client_token' => $this->string(36)->notNull(),
'account_id' => $this->db->getTableSchema('{{%accounts}}')->getColumn('id')->dbType . ' NOT NULL',
'created_at' => $this->integer()->unsigned()->notNull(),
'updated_at' => $this->integer()->unsigned()->notNull(),
]);
$this->addPrimaryKey('access_token', '{{%minecraft_access_keys}}', 'access_token');
$this->addForeignKey('FK_minecraft_access_token_to_account', '{{%minecraft_access_keys}}', 'account_id', '{{%accounts}}', 'id', 'CASCADE', 'CASCADE');
$this->createIndex('client_token', '{{%minecraft_access_keys}}', 'client_token', true);
}
public function safeDown() {
$this->dropTable('{{%minecraft_access_keys}}');
}
}