|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +use BaserCore\Database\Migration\BcMigration; |
| 5 | +use Phinx\Db\Adapter\PostgresAdapter; |
| 6 | + |
| 7 | +class AlterIdToBaserCoreAll extends BcMigration |
| 8 | +{ |
| 9 | + /** |
| 10 | + * Change Method. |
| 11 | + * |
| 12 | + * More information on this method is available here: |
| 13 | + * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method |
| 14 | + * @return void |
| 15 | + */ |
| 16 | + public function change() |
| 17 | + { |
| 18 | + $this->table('pages') |
| 19 | + ->changeColumn('id', 'integer', [ |
| 20 | + 'identity' => true, |
| 21 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 22 | + ]) |
| 23 | + ->update(); |
| 24 | + $this->table('password_requests') |
| 25 | + ->changeColumn('id', 'integer', [ |
| 26 | + 'identity' => true, |
| 27 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 28 | + ]) |
| 29 | + ->update(); |
| 30 | + $this->table('content_folders') |
| 31 | + ->changeColumn('id', 'integer', [ |
| 32 | + 'identity' => true, |
| 33 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 34 | + ]) |
| 35 | + ->update(); |
| 36 | + $this->table('plugins') |
| 37 | + ->changeColumn('id', 'integer', [ |
| 38 | + 'identity' => true, |
| 39 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 40 | + ]) |
| 41 | + ->update(); |
| 42 | + $this->table('user_groups') |
| 43 | + ->changeColumn('id', 'integer', [ |
| 44 | + 'identity' => true, |
| 45 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 46 | + ]) |
| 47 | + ->update(); |
| 48 | + $this->table('users') |
| 49 | + ->changeColumn('id', 'integer', [ |
| 50 | + 'identity' => true, |
| 51 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 52 | + ]) |
| 53 | + ->update(); |
| 54 | + $this->table('users_user_groups') |
| 55 | + ->changeColumn('id', 'integer', [ |
| 56 | + 'identity' => true, |
| 57 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 58 | + ]) |
| 59 | + ->update(); |
| 60 | + $this->table('login_stores') |
| 61 | + ->changeColumn('id', 'integer', [ |
| 62 | + 'identity' => true, |
| 63 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 64 | + ]) |
| 65 | + ->update(); |
| 66 | + $this->table('site_configs') |
| 67 | + ->changeColumn('id', 'integer', [ |
| 68 | + 'identity' => true, |
| 69 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 70 | + ]) |
| 71 | + ->update(); |
| 72 | + $this->table('dblogs') |
| 73 | + ->changeColumn('id', 'integer', [ |
| 74 | + 'identity' => true, |
| 75 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 76 | + ]) |
| 77 | + ->update(); |
| 78 | + $this->table('permissions') |
| 79 | + ->changeColumn('id', 'integer', [ |
| 80 | + 'identity' => true, |
| 81 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 82 | + ]) |
| 83 | + ->update(); |
| 84 | + $this->table('sites') |
| 85 | + ->changeColumn('id', 'integer', [ |
| 86 | + 'identity' => true, |
| 87 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 88 | + ]) |
| 89 | + ->update(); |
| 90 | + $this->table('contents') |
| 91 | + ->changeColumn('id', 'integer', [ |
| 92 | + 'identity' => true, |
| 93 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 94 | + ]) |
| 95 | + ->update(); |
| 96 | + $this->table('permission_groups') |
| 97 | + ->changeColumn('id', 'integer', [ |
| 98 | + 'identity' => true, |
| 99 | + 'generated' => PostgresAdapter::GENERATED_BY_DEFAULT |
| 100 | + ]) |
| 101 | + ->update(); |
| 102 | + } |
| 103 | + |
| 104 | +} |
0 commit comments