aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/sqlite/archives/patch-sites-rename-indexes.sql
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2024-12-12 22:57:31 +0100
committerDaimona Eaytoy <daimona.wiki@gmail.com>2024-12-13 03:12:56 +0100
commit251f4395865f8a33bcf32c6faa11748a14753492 (patch)
tree951d03a3860e9e1851cfe8e3c1ee8ea0c4217c29 /maintenance/sqlite/archives/patch-sites-rename-indexes.sql
parent589f6d5a40d7bf65250f174be1318a077733c5f5 (diff)
downloadmediawikicore-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-sites-rename-indexes.sql')
-rw-r--r--maintenance/sqlite/archives/patch-sites-rename-indexes.sql29
1 files changed, 0 insertions, 29 deletions
diff --git a/maintenance/sqlite/archives/patch-sites-rename-indexes.sql b/maintenance/sqlite/archives/patch-sites-rename-indexes.sql
deleted file mode 100644
index fdd09f141339..000000000000
--- a/maintenance/sqlite/archives/patch-sites-rename-indexes.sql
+++ /dev/null
@@ -1,29 +0,0 @@
--- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-sites-rename-indexes.json
--- Do not modify this file directly.
--- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX sites_global_key;
-DROP INDEX sites_type;
-DROP INDEX sites_group;
-DROP INDEX sites_source;
-DROP INDEX sites_language;
-DROP INDEX sites_protocol;
-DROP INDEX sites_domain;
-DROP INDEX sites_forward;
-CREATE TEMPORARY TABLE /*_*/__temp__sites AS
-SELECT site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config
-FROM /*_*/sites;
-DROP TABLE /*_*/sites;
-CREATE TABLE /*_*/sites ( site_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, site_global_key BLOB NOT NULL, site_type BLOB NOT NULL, site_group BLOB NOT NULL, site_source BLOB NOT NULL, site_language BLOB NOT NULL, site_protocol BLOB NOT NULL, site_domain VARCHAR(255) NOT NULL, site_data BLOB NOT NULL, site_forward SMALLINT NOT NULL, site_config BLOB NOT NULL );
-INSERT INTO /*_*/sites ( site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config )
-SELECT site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config
-FROM /*_*/__temp__sites;
-DROP TABLE /*_*/__temp__sites;
-CREATE UNIQUE INDEX site_global_key ON /*_*/sites (site_global_key);
-CREATE INDEX site_type ON /*_*/sites (site_type);
-CREATE INDEX site_group ON /*_*/sites (site_group);
-CREATE INDEX site_source ON /*_*/sites (site_source);
-CREATE INDEX site_language ON /*_*/sites (site_language);
-CREATE INDEX site_protocol ON /*_*/sites (site_protocol);
-CREATE INDEX site_domain ON /*_*/sites (site_domain);
-CREATE INDEX site_forward ON /*_*/sites (site_forward); \ No newline at end of file