For Postgres: - Drop foreign key from 'revactor_page' - Change datatype of 'revactor_actor' to BigInt as in MySQL/SQLite - Make 'revactor_page' non-nullable as in MySQL/SQLite For MySQL/SQLite: - Drop empty string default constraint from 'revactor_timestamp' as this is not allowed in the corresponding PG's TIMESTAMPTZ field Bug: T230428 Bug: T164898 Change-Id: I8c5c4b338a3000b1e4c2ab82fdae4a9819925868
17 lines
807 B
SQL
17 lines
807 B
SQL
CREATE TABLE /*_*/revision_actor_temp_tmp (
|
|
revactor_rev INTEGER UNSIGNED NOT NULL,
|
|
revactor_actor BIGINT UNSIGNED NOT NULL,
|
|
revactor_timestamp BLOB NOT NULL,
|
|
revactor_page INTEGER UNSIGNED NOT NULL,
|
|
PRIMARY KEY(revactor_rev, revactor_actor)
|
|
);
|
|
|
|
INSERT INTO /*_*/revision_actor_temp_tmp
|
|
SELECT revactor_rev, revactor_actor, revactor_timestamp, revactor_page
|
|
FROM /*_*/revision_actor_temp;
|
|
DROP TABLE /*_*/revision_actor_temp;
|
|
ALTER TABLE /*_*/revision_actor_temp_tmp RENAME TO /*_*/revision_actor_temp;
|
|
|
|
CREATE UNIQUE INDEX revactor_rev ON /*_*/revision_actor_temp (revactor_rev);
|
|
CREATE INDEX actor_timestamp ON /*_*/revision_actor_temp (revactor_actor, revactor_timestamp);
|
|
CREATE INDEX page_actor_timestamp ON /*_*/revision_actor_temp (revactor_page, revactor_actor, revactor_timestamp);
|