In order to migrate MySQL and Sqlite to abstract schema changed the iwl_title data type from varchar binary to varbinary. This wouldn't affect production. For migrating Postgres: - Turning the unique index to PK to make it in sync with MySQL Bug: T164898 Bug: T230428 Change-Id: Iaa625b66c874023b8cf2403917fa2fa120279208
16 lines
550 B
SQL
16 lines
550 B
SQL
CREATE TABLE /*_*/iwlinks_tmp (
|
|
iwl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
|
|
iwl_prefix BLOB DEFAULT '' NOT NULL,
|
|
iwl_title BLOB DEFAULT '' NOT NULL,
|
|
PRIMARY KEY(iwl_from, iwl_prefix, iwl_title)
|
|
);
|
|
|
|
INSERT INTO /*_*/iwlinks_tmp
|
|
SELECT iwl_from, iwl_prefix, iwl_title
|
|
FROM /*_*/iwlinks;
|
|
DROP TABLE /*_*/iwlinks;
|
|
ALTER TABLE /*_*/iwlinks_tmp RENAME TO /*_*/iwlinks;
|
|
|
|
CREATE INDEX iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from);
|
|
|
|
CREATE INDEX iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
|