Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Phinx\Util\Literal;
- use Phinx\Migration\AbstractMigration;
- class TableApartmentObjType extends AbstractMigration
- {
- public function up()
- {
- $this->execute(
- 'UPDATE `ore_nf_apartment_obj_type` ' .
- 'SET `icon_file` = "" ' .
- 'WHERE `icon_file` IS NULL'
- );
- $table = $this->table('ore_nf_apartment_obj_type');
- $table->changeColumn(
- 'icon_file',
- 'string',
- [
- 'length' => 255,
- 'signed' => false,
- 'default' => '',
- 'null' => false
- ]
- );
- $table->changeColumn(
- 'parent_id',
- 'integer',
- [
- 'signed' => false,
- 'default' => '0',
- 'null' => false
- ]
- );
- $table->save();
- }
- public function down()
- {
- $table = $this->table('ore_nf_apartment_obj_type');
- $table->changeColumn(
- 'icon_file',
- 'string',
- [
- 'length' => 255,
- 'null' => true,
- 'default' => Literal::from('NULL')
- ]
- );
- $table->changeColumn(
- 'parent_id',
- 'integer',
- [
- 'signed' => true,
- 'default' => '0',
- 'null' => false
- ]
- );
- $table->save();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement