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-oldimage-oi_timestamp.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-oldimage-oi_timestamp.sql')
-rw-r--r-- | maintenance/sqlite/archives/patch-oldimage-oi_timestamp.sql | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/maintenance/sqlite/archives/patch-oldimage-oi_timestamp.sql b/maintenance/sqlite/archives/patch-oldimage-oi_timestamp.sql deleted file mode 100644 index 411a6f8ed277..000000000000 --- a/maintenance/sqlite/archives/patch-oldimage-oi_timestamp.sql +++ /dev/null @@ -1,22 +0,0 @@ --- This file is automatically generated using maintenance/generateSchemaChangeSql.php. --- Source: maintenance/abstractSchemaChanges/patch-oldimage-oi_timestamp.json --- Do not modify this file directly. --- See https://www.mediawiki.org/wiki/Manual:Schema_changes -DROP INDEX oi_actor_timestamp; -DROP INDEX oi_name_timestamp; -DROP INDEX oi_name_archive_name; -DROP INDEX oi_sha1; -CREATE TEMPORARY TABLE /*_*/__temp__oldimage AS -SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1 -FROM /*_*/oldimage; -DROP TABLE /*_*/oldimage; -CREATE TABLE /*_*/oldimage ( oi_name BLOB DEFAULT '' NOT NULL, oi_archive_name BLOB DEFAULT '' NOT NULL, oi_size INTEGER UNSIGNED DEFAULT 0 NOT NULL, oi_width INTEGER DEFAULT 0 NOT NULL, oi_height INTEGER DEFAULT 0 NOT NULL, oi_bits INTEGER DEFAULT 0 NOT NULL, oi_description_id BIGINT UNSIGNED NOT NULL, oi_actor BIGINT UNSIGNED NOT NULL, oi_timestamp BLOB NOT NULL, oi_metadata BLOB NOT NULL, oi_media_type TEXT DEFAULT NULL, oi_major_mime TEXT DEFAULT 'unknown' NOT NULL, oi_minor_mime BLOB DEFAULT 'unknown' NOT NULL, oi_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, oi_sha1 BLOB DEFAULT '' NOT NULL ); -INSERT INTO /*_*/oldimage ( oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1 ) -SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1 -FROM /*_*/__temp__oldimage; -DROP TABLE /*_*/__temp__oldimage; -CREATE INDEX oi_actor_timestamp ON /*_*/oldimage (oi_actor, oi_timestamp); -CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp); -CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name); -CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1); -CREATE INDEX oi_timestamp ON /*_*/oldimage (oi_timestamp);
\ No newline at end of file |