Skip to content

Commit dbb4a30

Browse files
committed
Fix migration
1 parent 58a1952 commit dbb4a30

2 files changed

Lines changed: 5 additions & 32 deletions

File tree

‎migrations/v30x/m20_unicode_language_trees.php‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,14 @@ public function update_schema()
3939
}
4040

4141
/**
42-
* {@inheritdoc}
42+
* Keep the changed columns until the initial schema migration drops the table.
43+
* Reverting them could fail when existing data no longer fits the old types.
44+
*
45+
* @return array Array of table schema changes
4346
*/
4447
public function revert_schema()
4548
{
46-
return array(
47-
'change_columns' => array(
48-
$this->table_prefix . 'boardrules' => array(
49-
'rule_title' => array('VCHAR:200', ''),
50-
'rule_anchor' => array('VCHAR:255', ''),
51-
),
52-
),
53-
);
49+
return array();
5450
}
5551

5652
/**

‎tests/migrations/v310_upgrade_test.php‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,4 @@ public function test_table_lock_config_is_removed_only_on_revert(): void
190190
array('config.remove', array('boardrules.table_lock.boardrules_table')),
191191
), $migration->revert_data());
192192
}
193-
194-
public function test_unicode_schema_is_reversible(): void
195-
{
196-
global $phpbb_root_path, $phpEx;
197-
$factory = new \phpbb\db\tools\factory();
198-
$migration = new \phpbb\boardrules\migrations\v30x\m20_unicode_language_trees(
199-
new \phpbb\config\config(array()),
200-
$this->db,
201-
$factory->get($this->db, true),
202-
$phpbb_root_path,
203-
$phpEx,
204-
'phpbb_'
205-
);
206-
207-
self::assertSame(array(
208-
'change_columns' => array(
209-
'phpbb_boardrules' => array(
210-
'rule_title' => array('VCHAR:200', ''),
211-
'rule_anchor' => array('VCHAR:255', ''),
212-
),
213-
),
214-
), $migration->revert_schema());
215-
}
216193
}

0 commit comments

Comments
 (0)