'DeleteAction' => __DIR__ . '/includes/actions/DeleteAction.php',
'DeleteArchivedFiles' => __DIR__ . '/maintenance/deleteArchivedFiles.php',
'DeleteArchivedRevisions' => __DIR__ . '/maintenance/deleteArchivedRevisions.php',
+ 'DeleteAutoPatrolLogs' => __DIR__ . '/maintenance/deleteAutoPatrolLogs.php',
'DeleteBatch' => __DIR__ . '/maintenance/deleteBatch.php',
'DeleteDefaultMessages' => __DIR__ . '/maintenance/deleteDefaultMessages.php',
'DeleteEqualMessages' => __DIR__ . '/maintenance/deleteEqualMessages.php',
'PoolCounterWorkViaCallback' => __DIR__ . '/includes/poolcounter/PoolCounterWorkViaCallback.php',
'PoolCounter_Stub' => __DIR__ . '/includes/poolcounter/PoolCounter.php',
'PoolWorkArticleView' => __DIR__ . '/includes/poolcounter/PoolWorkArticleView.php',
+ 'PopulateArchiveRevId' => __DIR__ . '/maintenance/populateArchiveRevId.php',
'PopulateBacklinkNamespace' => __DIR__ . '/maintenance/populateBacklinkNamespace.php',
'PopulateCategory' => __DIR__ . '/maintenance/populateCategory.php',
'PopulateContentModel' => __DIR__ . '/maintenance/populateContentModel.php',
// Should have been in 1.30
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
+ // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+ [ 'addField', 'image', 'img_description_id', 'patch-image-img_description_id.sql' ],
+ // Should have been in 1.30
[ 'migrateComments' ],
// 1.31
[ 'migrateActors' ],
[ 'modifyField', 'revision', 'rev_text_id', 'patch-rev_text_id-default.sql' ],
[ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+ [ 'populateArchiveRevId' ],
];
}
[ 'renameIndex', 'user_properties', 'user_properties_user_property', 'PRIMARY', false,
'patch-user_properties-fix-pk.sql' ],
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
+
+ // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+ [ 'addField', 'image', 'img_description_id', 'patch-image-img_description_id.sql' ],
+
[ 'migrateComments' ],
[ 'renameIndex', 'l10n_cache', 'lc_lang_key', 'PRIMARY', false,
'patch-l10n_cache-primary-key.sql' ],
[ 'migrateActors' ],
[ 'modifyField', 'revision', 'rev_text_id', 'patch-rev_text_id-default.sql' ],
[ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+ [ 'populateArchiveRevId' ],
];
}
// Should have been in 1.30
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
+ // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+ [ 'addField', 'image', 'img_description_id', 'patch-image-img_description_id.sql' ],
+ // Should have been in 1.30
[ 'migrateComments' ],
// 1.31
[ 'addTable', 'actor', 'patch-actor-table.sql' ],
[ 'migrateActors' ],
[ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+ [ 'populateArchiveRevId' ],
// KEEP THIS AT THE BOTTOM!!
[ 'doRebuildDuplicateFunction' ],
[ 'changeNullableField', 'protected_titles', 'pt_reason', 'NOT NULL', true ],
[ 'addPgField', 'protected_titles', 'pt_reason_id', 'INTEGER NOT NULL DEFAULT 0' ],
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
+
+ // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+ [ 'addPgField', 'image', 'img_description_id', 'INTEGER NOT NULL DEFAULT 0' ],
+
[ 'migrateComments' ],
[ 'addIndex', 'site_stats', 'site_stats_pkey', 'patch-site_stats-pk.sql' ],
[ 'addTable', 'ip_changes', 'patch-ip_changes.sql' ],
[ 'addPgIndex', 'logging', 'logging_actor_time', '( log_actor, log_timestamp )' ],
[ 'migrateActors' ],
[ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+ [ 'populateArchiveRevId' ],
];
}
[ 'renameIndex', 'user_properties', 'user_properties_user_property', 'PRIMARY', false,
'patch-user_properties-fix-pk.sql' ],
[ 'addTable', 'comment', 'patch-comment-table.sql' ],
+
+ // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+ [ 'addField', 'image', 'img_description_id', 'patch-image-img_description_id.sql' ],
+
[ 'migrateComments' ],
[ 'renameIndex', 'l10n_cache', 'lc_lang_key', 'PRIMARY', false,
'patch-l10n_cache-primary-key.sql' ],
[ 'migrateActors' ],
[ 'modifyField', 'revision', 'rev_text_id', 'patch-rev_text_id-default.sql' ],
[ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+ [ 'populateArchiveRevId' ],
];
}
ar_timestamp varchar(14) NOT NULL default '',
ar_minor_edit BIT NOT NULL DEFAULT 0,
ar_flags NVARCHAR(255) NOT NULL,
- ar_rev_id INT NULL, -- NOT a FK, the row gets deleted from revision and moved here
+ ar_rev_id INT NOT NULL, -- NOT a FK, the row gets deleted from revision and moved here
ar_text_id INT CONSTRAINT ar_text_id__old_id__fk FOREIGN KEY REFERENCES /*_*/text(old_id) ON DELETE CASCADE,
ar_deleted TINYINT NOT NULL DEFAULT 0,
ar_len INT,
-- Description field as entered by the uploader.
-- This is displayed in image upload history and logs.
img_description nvarchar(255) NOT NULL CONSTRAINT DF_img_description DEFAULT '',
+ img_description_id bigint NOT NULL CONSTRAINT DF_img_description_id DEFAULT 0 CONSTRAINT FK_img_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
-- user_id and user_name of uploader.
img_user int REFERENCES /*_*/mwuser(user_id) ON DELETE SET NULL,
ar_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
ar_minor_edit CHAR(1) DEFAULT '0' NOT NULL,
ar_flags VARCHAR2(255),
- ar_rev_id NUMBER,
+ ar_rev_id NUMBER NOT NULL,
ar_text_id NUMBER,
ar_deleted CHAR(1) DEFAULT '0' NOT NULL,
ar_len NUMBER,
img_major_mime VARCHAR2(32) DEFAULT 'unknown',
img_minor_mime VARCHAR2(100) DEFAULT 'unknown',
img_description VARCHAR2(255),
+ img_description_id NUMBER DEFAULT 0 NOT NULL,
img_user NUMBER DEFAULT 0 NOT NULL,
img_user_text VARCHAR2(255) NULL,
img_actor NUMBER DEFAULT 0 NOT NULL,
);
ALTER TABLE &mw_prefix.image ADD CONSTRAINT &mw_prefix.image_pk PRIMARY KEY (img_name);
ALTER TABLE &mw_prefix.image ADD CONSTRAINT &mw_prefix.image_fk1 FOREIGN KEY (img_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE &mw_prefix.image ADD CONSTRAINT &mw_prefix.image_fk2 FOREIGN KEY (img_description_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX &mw_prefix.image_i01 ON &mw_prefix.image (img_user_text,img_timestamp);
CREATE INDEX &mw_prefix.image_i02 ON &mw_prefix.image (img_size);
CREATE INDEX &mw_prefix.image_i03 ON &mw_prefix.image (img_timestamp);
ar_timestamp TIMESTAMPTZ NOT NULL,
ar_minor_edit SMALLINT NOT NULL DEFAULT 0,
ar_flags TEXT,
- ar_rev_id INTEGER,
+ ar_rev_id INTEGER NOT NULL,
ar_text_id INTEGER,
ar_deleted SMALLINT NOT NULL DEFAULT 0,
ar_len INTEGER NULL,
img_major_mime TEXT DEFAULT 'unknown',
img_minor_mime TEXT DEFAULT 'unknown',
img_description TEXT NOT NULL DEFAULT '',
+ img_description_id INTEGER NOT NULL DEFAULT 0,
img_user INTEGER NOT NULL DEFAULT 0 REFERENCES mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
img_user_text TEXT NOT NULL DEFAULT '',
img_actor INTEGER NOT NULL DEFAULT 0,
--
-- @since 1.5 Entries from 1.4 will be NULL here. When restoring
-- archive rows from before 1.5, a new rev_id is created.
- ar_rev_id int unsigned,
+ ar_rev_id int unsigned NOT NULL,
-- Copied from rev_text_id, references text.old_id.
-- To avoid breaking the block-compression scheme and otherwise making
-- Description field as entered by the uploader.
-- This is displayed in image upload history and logs.
- -- Deprecated in favor of image_comment_temp.imgcomment_description_id.
+ -- Deprecated in favor of img_description_id.
img_description varbinary(767) NOT NULL default '',
+ img_description_id bigint unsigned NOT NULL DEFAULT 0, -- ("DEFAULT 0" is temporary, signaling that img_description should be used)
+
-- user_id and user_name of uploader.
-- Deprecated in favor of img_actor.
img_user int unsigned NOT NULL default 0,