diff options
author | Daimona Eaytoy <daimona.wiki@gmail.com> | 2024-12-12 22:57:31 +0100 |
---|---|---|
committer | Daimona Eaytoy <daimona.wiki@gmail.com> | 2024-12-13 03:12:56 +0100 |
commit | 251f4395865f8a33bcf32c6faa11748a14753492 (patch) | |
tree | 951d03a3860e9e1851cfe8e3c1ee8ea0c4217c29 /maintenance/sqlite/archives/patch-logging-rename-indexes.sql | |
parent | 589f6d5a40d7bf65250f174be1318a077733c5f5 (diff) | |
download | mediawikicore-251f4395865f8a33bcf32c6faa11748a14753492.tar.gz mediawikicore-251f4395865f8a33bcf32c6faa11748a14753492.zip |
Move SQL schema and schema changes to new sql/ top-level directory
This is the standard in every extension. DB schema changes are not
maintenance scripts, and therefore there's no apparent reason to have
the two things together, besides historical reasons.
Also, put each DB type in a separate directory, which wasn't the case
for MySQL before. For SQLite and Postgres schema changes, we now
follow the convention (used everywhere else, including the
generateSchemaChangeSql script) of having the DB type as the last part
of the path. This lets us generate schema changes for all DB types at
once, and without specifying the full file path.
Most files are just being renamed, the exceptions being to update
references to the old location (sometimes still referencing tables.sql).
Note that the old path is still referenced in the autogenerated comment
of schema changes SQL files. These will be regenerated in another
commit. Instead, the schema files are done now, because they're covered
by DatabaseIntegrationTest that would otherwise fail.
Bug: T382030
Change-Id: I3b4a614366d0bc629523ac40ce97d001f3b6bcf8
Diffstat (limited to 'maintenance/sqlite/archives/patch-logging-rename-indexes.sql')
-rw-r--r-- | maintenance/sqlite/archives/patch-logging-rename-indexes.sql | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/maintenance/sqlite/archives/patch-logging-rename-indexes.sql b/maintenance/sqlite/archives/patch-logging-rename-indexes.sql deleted file mode 100644 index f2da25425437..000000000000 --- a/maintenance/sqlite/archives/patch-logging-rename-indexes.sql +++ /dev/null @@ -1,27 +0,0 @@ --- This file is automatically generated using maintenance/generateSchemaChangeSql.php. --- Source: maintenance/abstractSchemaChanges/patch-logging-rename-indexes.json --- Do not modify this file directly. --- See https://www.mediawiki.org/wiki/Manual:Schema_changes -DROP INDEX type_time; -DROP INDEX actor_time; -DROP INDEX page_time; -DROP INDEX times; -DROP INDEX log_actor_type_time; -DROP INDEX log_page_id_time; -DROP INDEX log_type_action; -CREATE TEMPORARY TABLE /*_*/__temp__logging AS -SELECT log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted -FROM /*_*/logging; -DROP TABLE /*_*/logging; -CREATE TABLE /*_*/logging ( log_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, log_type BLOB DEFAULT '' NOT NULL, log_action BLOB DEFAULT '' NOT NULL, log_timestamp BLOB DEFAULT '19700101000000' NOT NULL, log_actor BIGINT UNSIGNED NOT NULL, log_namespace INTEGER DEFAULT 0 NOT NULL, log_title BLOB DEFAULT '' NOT NULL, log_page INTEGER UNSIGNED DEFAULT NULL, log_comment_id BIGINT UNSIGNED NOT NULL, log_params BLOB NOT NULL, log_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL ); -INSERT INTO /*_*/logging ( log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted ) -SELECT log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted -FROM /*_*/__temp__logging; -DROP TABLE /*_*/__temp__logging; -CREATE INDEX log_actor_type_time ON /*_*/logging ( log_actor, log_type, log_timestamp ); -CREATE INDEX log_page_id_time ON /*_*/logging (log_page, log_timestamp); -CREATE INDEX log_type_action ON /*_*/logging ( log_type, log_action, log_timestamp ); -CREATE INDEX log_type_time ON /*_*/logging (log_type, log_timestamp); -CREATE INDEX log_actor_time ON /*_*/logging (log_actor, log_timestamp); -CREATE INDEX log_page_time ON /*_*/logging ( log_namespace, log_title, log_timestamp ); -CREATE INDEX log_times ON /*_*/logging (log_timestamp);
\ No newline at end of file |