Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class update_cms_310 extends Migration implements MigrationInterface |
||
10 | { |
||
11 | /** |
||
12 | * Implement new update changes |
||
13 | * @return void |
||
14 | */ |
||
15 | public function up() |
||
16 | { |
||
17 | $this->getSchema()->table('users', function($table){ |
||
18 | $table->string('approve_token', 128)->nullable()->default(null)->change(); |
||
19 | }); |
||
20 | // set approve_token = null where it like '0' str or '' |
||
21 | \Apps\ActiveRecord\User::where('approve_token', '=', '0') |
||
22 | ->update('approve_token', null); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return void |
||
27 | */ |
||
28 | public function down() |
||
29 | { |
||
30 | parent::down(); // TODO: Change the autogenerated stub |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Seed created table via up() method with some data |
||
35 | * @return void |
||
36 | */ |
||
37 | public function seed() |
||
39 | // TODO: Implement seed() method. |
||
40 | } |
||
41 | } |