Once the schema has been created in the code, and before enabling it to production, it should be tested on beta.
Checklist
- Create the new table:
$ sql wikishared --write
CREATE TABLE ce_tracking_tools ( cett_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, cett_event BIGINT UNSIGNED NOT NULL, cett_tool_id INT NOT NULL, cett_tool_event_id VARBINARY(512) NOT NULL, cett_sync_status INT NOT NULL, cett_last_sync BINARY(14) DEFAULT NULL, UNIQUE INDEX cett_event_tool_teid ( cett_event, cett_tool_id, cett_tool_event_id ), PRIMARY KEY(cett_id) );
- Configure beta to read/write the new schema
- Wait until the old columns and the migration logic have been dropped in the code
- Drop the old columns:
$ sql wikishared --write
ALTER TABLE campaign_events DROP COLUMN event_tracking_tool_id, DROP COLUMN event_tracking_tool_event_id;
- Remove the migration variable from the beta config