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-block_target.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-block_target.sql')
-rw-r--r-- | maintenance/sqlite/archives/patch-block_target.sql | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/maintenance/sqlite/archives/patch-block_target.sql b/maintenance/sqlite/archives/patch-block_target.sql deleted file mode 100644 index b77254995bd0..000000000000 --- a/maintenance/sqlite/archives/patch-block_target.sql +++ /dev/null @@ -1,41 +0,0 @@ - -CREATE TABLE /*_*/block ( - bl_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - bl_target INTEGER UNSIGNED NOT NULL, - bl_by_actor BIGINT UNSIGNED NOT NULL, - bl_reason_id BIGINT UNSIGNED NOT NULL, - bl_timestamp BLOB NOT NULL, bl_anon_only SMALLINT DEFAULT 0 NOT NULL, - bl_create_account SMALLINT DEFAULT 1 NOT NULL, - bl_enable_autoblock SMALLINT DEFAULT 1 NOT NULL, - bl_expiry BLOB NOT NULL, bl_deleted SMALLINT DEFAULT 0 NOT NULL, - bl_block_email SMALLINT DEFAULT 0 NOT NULL, - bl_allow_usertalk SMALLINT DEFAULT 0 NOT NULL, - bl_parent_block_id INTEGER UNSIGNED DEFAULT NULL, - bl_sitewide SMALLINT DEFAULT 1 NOT NULL -); - -CREATE INDEX bl_timestamp ON /*_*/block (bl_timestamp); - -CREATE INDEX bl_target ON /*_*/block (bl_target); - -CREATE INDEX bl_expiry ON /*_*/block (bl_expiry); - -CREATE INDEX bl_parent_block_id ON /*_*/block (bl_parent_block_id); - - -CREATE TABLE /*_*/block_target ( - bt_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - bt_address BLOB DEFAULT NULL, bt_user INTEGER UNSIGNED DEFAULT NULL, - bt_user_text BLOB DEFAULT NULL, bt_auto SMALLINT DEFAULT 0 NOT NULL, - bt_range_start BLOB DEFAULT NULL, - bt_range_end BLOB DEFAULT NULL, bt_ip_hex BLOB DEFAULT NULL, - bt_count INTEGER DEFAULT 0 NOT NULL -); - -CREATE INDEX bt_address ON /*_*/block_target (bt_address); - -CREATE INDEX bt_ip_user_text ON /*_*/block_target (bt_ip_hex, bt_user_text); - -CREATE INDEX bt_range ON /*_*/block_target (bt_range_start, bt_range_end); - -CREATE INDEX bt_user ON /*_*/block_target (bt_user); |