aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/sqlite/tables-generated.sql
diff options
context:
space:
mode:
authorAmir Sarabadani <Ladsgroup@gmail.com>2020-12-20 22:42:14 +0100
committerAmir Sarabadani <Ladsgroup@gmail.com>2020-12-23 04:04:27 +0100
commit37fc2d1ba1f61b93f3f48d95f791120e42458230 (patch)
treedb8b4c73f28246c7198c53197c791e3fdcb2f4f3 /maintenance/sqlite/tables-generated.sql
parentca93fc5eacb61ba02e3ace87571cd86f0941ef84 (diff)
downloadmediawikicore-37fc2d1ba1f61b93f3f48d95f791120e42458230.tar.gz
mediawikicore-37fc2d1ba1f61b93f3f48d95f791120e42458230.zip
Migrate filearchive to abstract schema
For MySQL: - Drop default from fa_deleted_timestamp and fa_timestamp - Change fa_name and fa_storage_group from varchar() binary to varbinary() For Postgres: - Set default for three fields - Drop foreign key on fa_deleted_user - Change field type for five fields - Rename indexes to make it make in sync with MySQL/Postgres - Rebuild an index to make it in sync MySQL/Postgres Bug: T230428 Bug: T164898 Bug: T42626 Change-Id: Ia2be151c46c73f15592db03540834a6456460cac
Diffstat (limited to 'maintenance/sqlite/tables-generated.sql')
-rw-r--r--maintenance/sqlite/tables-generated.sql31
1 files changed, 31 insertions, 0 deletions
diff --git a/maintenance/sqlite/tables-generated.sql b/maintenance/sqlite/tables-generated.sql
index a8937584a3f0..763bbc948efc 100644
--- a/maintenance/sqlite/tables-generated.sql
+++ b/maintenance/sqlite/tables-generated.sql
@@ -611,3 +611,34 @@ CREATE INDEX us_user ON /*_*/uploadstash (us_user);
CREATE UNIQUE INDEX us_key ON /*_*/uploadstash (us_key);
CREATE INDEX us_timestamp ON /*_*/uploadstash (us_timestamp);
+
+
+CREATE TABLE /*_*/filearchive (
+ fa_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ fa_name BLOB DEFAULT '' NOT NULL, fa_archive_name BLOB DEFAULT '',
+ fa_storage_group BLOB DEFAULT NULL,
+ fa_storage_key BLOB DEFAULT '', fa_deleted_user INTEGER DEFAULT NULL,
+ fa_deleted_timestamp BLOB DEFAULT NULL,
+ fa_deleted_reason_id BIGINT UNSIGNED NOT NULL,
+ fa_size INTEGER UNSIGNED DEFAULT 0,
+ fa_width INTEGER DEFAULT 0, fa_height INTEGER DEFAULT 0,
+ fa_metadata BLOB DEFAULT NULL, fa_bits INTEGER DEFAULT 0,
+ fa_media_type TEXT DEFAULT NULL, fa_major_mime TEXT DEFAULT 'unknown',
+ fa_minor_mime BLOB DEFAULT 'unknown',
+ fa_description_id BIGINT UNSIGNED NOT NULL,
+ fa_actor BIGINT UNSIGNED NOT NULL,
+ fa_timestamp BLOB DEFAULT NULL, fa_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ fa_sha1 BLOB DEFAULT '' NOT NULL
+);
+
+CREATE INDEX fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
+
+CREATE INDEX fa_storage_group ON /*_*/filearchive (
+ fa_storage_group, fa_storage_key
+);
+
+CREATE INDEX fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
+
+CREATE INDEX fa_actor_timestamp ON /*_*/filearchive (fa_actor, fa_timestamp);
+
+CREATE INDEX fa_sha1 ON /*_*/filearchive (fa_sha1);