mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 06:39:46 +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());
|
||
|
}
|
||
|
|
||
|
}
|