- Affected version
- 2.0 Beta 5
My add-on Thread starter alerts extends xf_user_option.default_watch_state to include a new default state.
It blows up the add-on upgrade process with:
If I try to create the column myself with:
I get the error:
What would be the best way to migrate this for users of my add-on without data loss?
So far all I can think of is creating a temporary column before the upgrade, copy the column over, and then patch up after (doing effectively a manual version of step 33). Which is really yuck.
It blows up the add-on upgrade process with:
Code:
Running upgrade to 2.0.0 Alpha, step 33...
[XF\Db\Exception]
MySQL query error [1265]: Data truncated for column 'interaction_watch_state' at row 908
If I try to create the column myself with:
Code:
ALTER TABLE `xf_user_option`
ADD COLUMN `interaction_watch_state` ENUM('','watch_no_email','watch_email','watch_op_email') NOT NULL DEFAULT '' AFTER default_watch_state;
Code:
Running upgrade to 2.0.0 Alpha, step 20...
[LogicException]
interaction_watch_state already exists in table, but cannot change enum values
What would be the best way to migrate this for users of my add-on without data loss?
So far all I can think of is creating a temporary column before the upgrade, copy the column over, and then patch up after (doing effectively a manual version of step 33). Which is really yuck.