| @@ 6-37 (lines=32) @@ | ||
| 3 | ||
| 4 | use Phinx\Migration\AbstractMigration; |
|
| 5 | ||
| 6 | class AddDescriptionFieldForRole extends AbstractMigration |
|
| 7 | { |
|
| 8 | /** |
|
| 9 | * Change Method. |
|
| 10 | * |
|
| 11 | * Write your reversible migrations using this method. |
|
| 12 | * |
|
| 13 | * More information on writing migrations is available here: |
|
| 14 | * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class |
|
| 15 | * |
|
| 16 | * The following commands can be used in this method and Phinx will |
|
| 17 | * automatically reverse them when rolling back: |
|
| 18 | * |
|
| 19 | * createTable |
|
| 20 | * renameTable |
|
| 21 | * addColumn |
|
| 22 | * renameColumn |
|
| 23 | * addIndex |
|
| 24 | * addForeignKey |
|
| 25 | * |
|
| 26 | * Remember to call "create()" or "update()" and NOT "save()" when working |
|
| 27 | * with the Table class. |
|
| 28 | */ |
|
| 29 | public function change() |
|
| 30 | { |
|
| 31 | $roleTable = $this->table('role'); |
|
| 32 | ||
| 33 | $roleTable |
|
| 34 | ->addColumn('description', 'string', ['null' => true, 'comment' => 'description of role']) |
|
| 35 | ->update(); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| @@ 6-37 (lines=32) @@ | ||
| 3 | ||
| 4 | use Phinx\Migration\AbstractMigration; |
|
| 5 | ||
| 6 | class AddDescriptionFieldForPermission extends AbstractMigration |
|
| 7 | { |
|
| 8 | /** |
|
| 9 | * Change Method. |
|
| 10 | * |
|
| 11 | * Write your reversible migrations using this method. |
|
| 12 | * |
|
| 13 | * More information on writing migrations is available here: |
|
| 14 | * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class |
|
| 15 | * |
|
| 16 | * The following commands can be used in this method and Phinx will |
|
| 17 | * automatically reverse them when rolling back: |
|
| 18 | * |
|
| 19 | * createTable |
|
| 20 | * renameTable |
|
| 21 | * addColumn |
|
| 22 | * renameColumn |
|
| 23 | * addIndex |
|
| 24 | * addForeignKey |
|
| 25 | * |
|
| 26 | * Remember to call "create()" or "update()" and NOT "save()" when working |
|
| 27 | * with the Table class. |
|
| 28 | */ |
|
| 29 | public function change() |
|
| 30 | { |
|
| 31 | $permissionTable = $this->table('permission'); |
|
| 32 | ||
| 33 | $permissionTable |
|
| 34 | ->addColumn('description', 'string', ['null' => true, 'comment' => 'description of permission']) |
|
| 35 | ->update(); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||