mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 23:50:19 +05:30
17 lines
423 B
PHP
17 lines
423 B
PHP
|
<?php
|
||
|
|
||
|
use console\db\Migration;
|
||
|
|
||
|
class m170704_215436_allow_null_owner_id extends Migration {
|
||
|
|
||
|
public function safeUp() {
|
||
|
$this->alterColumn('{{%oauth_sessions}}', 'owner_id', $this->string()->null());
|
||
|
}
|
||
|
|
||
|
public function safeDown() {
|
||
|
$this->delete('{{%oauth_sessions}}', ['owner_id' => null]);
|
||
|
$this->alterColumn('{{%oauth_sessions}}', 'owner_id', $this->string()->notNull());
|
||
|
}
|
||
|
|
||
|
}
|