|
| 1 | +<?php |
| 2 | + |
| 3 | +class UpdateUserConfig extends Phinx\Migration\AbstractMigration |
| 4 | +{ |
| 5 | + public function change() |
| 6 | + { |
| 7 | + $this->table('user_config', [ |
| 8 | + 'id' => false, |
| 9 | + 'primary_key' => ['users_id', 'name'], |
| 10 | + 'engine' => 'InnoDB', |
| 11 | + 'encoding' => 'utf8mb4', |
| 12 | + 'collation' => 'utf8mb4_unicode_ci', |
| 13 | + 'comment' => '', |
| 14 | + 'row_format' => 'COMPACT', |
| 15 | + ]) |
| 16 | + ->changeColumn('value', 'text', [ |
| 17 | + 'null' => true, |
| 18 | + 'default' => null, |
| 19 | + 'limit' => 65535, |
| 20 | + 'collation' => 'utf8mb4_unicode_ci', |
| 21 | + 'encoding' => 'utf8mb4', |
| 22 | + 'after' => 'name', |
| 23 | + ]) |
| 24 | + ->addIndex(['created_at'], [ |
| 25 | + 'name' => 'created_at', |
| 26 | + 'unique' => false, |
| 27 | + ]) |
| 28 | + ->addIndex(['updated_at'], [ |
| 29 | + 'name' => 'updated_at', |
| 30 | + 'unique' => false, |
| 31 | + ]) |
| 32 | + ->save(); |
| 33 | + $this->table('companies_settings', [ |
| 34 | + 'id' => false, |
| 35 | + 'primary_key' => ['companies_id', 'name'], |
| 36 | + 'engine' => 'InnoDB', |
| 37 | + 'encoding' => 'utf8mb4', |
| 38 | + 'collation' => 'utf8mb4_unicode_ci', |
| 39 | + 'comment' => '', |
| 40 | + 'row_format' => 'COMPACT', |
| 41 | + ]) |
| 42 | + ->addIndex(['created_at'], [ |
| 43 | + 'name' => 'created_at', |
| 44 | + 'unique' => false, |
| 45 | + ]) |
| 46 | + ->addIndex(['updated_at'], [ |
| 47 | + 'name' => 'updated_at', |
| 48 | + 'unique' => false, |
| 49 | + ]) |
| 50 | + ->addIndex(['is_deleted'], [ |
| 51 | + 'name' => 'is_deleted', |
| 52 | + 'unique' => false, |
| 53 | + ]) |
| 54 | + ->save(); |
| 55 | + } |
| 56 | +} |
0 commit comments