X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fmssql%2Farchives%2Fpatch-slots.sql;h=2fc615ecc9e5861f34d40028b74a4d32f1d91941;hb=dccec1276144d2d59c0d1a25c881a6a15947da64;hp=91d3168238f3beb3e4bd06a5e9b9ea16d43fb6c3;hpb=3f59cb9f3a53ad28f8a95fe299c5de6abd24b453;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mssql/archives/patch-slots.sql b/maintenance/mssql/archives/patch-slots.sql index 91d3168238..2fc615ecc9 100644 --- a/maintenance/mssql/archives/patch-slots.sql +++ b/maintenance/mssql/archives/patch-slots.sql @@ -6,19 +6,20 @@ CREATE TABLE /*_*/slots ( -- reference to rev_id - slot_revision_id bigint unsigned NOT NULL, + slot_revision_id bigint NOT NULL, -- reference to role_id - slot_role_id smallint unsigned NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id), + slot_role_id smallint NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id), -- reference to content_id - slot_content_id bigint unsigned NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id), + slot_content_id bigint NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id), - -- whether the content is inherited (1) or new in this revision (0) - slot_inherited tinyint unsigned NOT NULL CONSTRAINT DF_slot_inherited DEFAULT 0, + -- The revision ID of the revision that originated the slot's content. + -- To find revisions that changed slots, look for slot_origin = slot_revision_id. + slot_origin bigint NOT NULL, CONSTRAINT PK_slots PRIMARY KEY (slot_revision_id, slot_role_id) ); -- Index for finding revisions that modified a specific slot -CREATE INDEX /*i*/slot_role_inherited ON /*_*/slots (slot_revision_id, slot_role_id, slot_inherited); \ No newline at end of file +CREATE INDEX /*i*/slot_revision_origin_role ON /*_*/slots (slot_revision_id, slot_origin, slot_role_id);