| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
To follow database coding convention and avoid clashes in RDBMS engines
where indexes are global
Bug: T270033
Change-Id: I17028bba489d04b01d22c39dc8935a4f0f771c7e
|
|
|
|
|
|
|
| |
Use uniform prefix with the column names
Bug: T270033
Change-Id: I771ffc67a1363d8877c57dce1d8b2acdca8fe5bb
|
|
|
|
|
|
|
| |
Use uniform prefix with the column names
Bug: T270033
Change-Id: I9ee1f8ac9a8d0e575e16344910495f341c2714db
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For MySQL:
- Migrating us_timestamp from varbinary(14) to binary(14) to
standardize timestamp fields
For postgres:
- Fixing datatype of 8 fields of the table
- Set "NOT NULL" for 7 fields
- Rename indexes to drop _idx suffix
Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: I5391416ae463856cf5e9b05f542dec9b389b2f7c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some changes needed for the migration:
Postgres:
- Add default to five fields that have it in MySQL
- Make log_params not nullable
- Change log_comment_id and log_actor type to big integer
- Change log_namespace to integer
- Drop logging_actor_time index
MySQL/SQLite
- Change log_title to varbinary/BLOB
Bug: T230428
Bug: T164898
Change-Id: Iad59d2a78f61d93637917ca320d3e173863ce5e1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To get MySQL/SQLite migrated, changing type of cl_to and
cl_sortkey_prefix from "varchar() binary" to varbinary
For Postgres:
- Dropping foreign key on cl_from
- Setting proper default for cl_from, cl_to, cl_sortkey, cl_collation
- Set cl_sortkey to not nullable
- Dropping unique index cl_from which in turn should become PK
- Adding several missing indexes
- Fixing columns of cl_sortkey
Bug: T230428
Bug: T164898
Change-Id: I83043ef41f9c753734f1e4b51237d979031dd71a
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These tables don't have drift between MySQL and Postgres but their
primary keys don't have explicit "NOT NULL" statement making them
nullable in sqlite. Fixing this drift.
Also changing the PK fields of these two tables from smallint to int,
given that PG would be complicated with smallint auto_increment PKs
Bug: T230428
Bug: T258366
Change-Id: Icf6ce044eaf0f09b1a2bdd8a1f618cef1e0415bf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Postgres:
- Drop deafault from job_id
- Add default to job_cmd
- Change job_namespace datatype to INTEGER
- Drop job_cmd_namespace_title index
- Add job_cmd index on the same fields as MySQL
- Rename index job_timestamp_idx
MySQL:
- Change job_title datatype to VARBINARY
- Change job_timestamp datatype to BINARY (mwtimestamp)
- Change job_token_timestamp datatype to BINARY (mwtimestamp)
Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: I207aefc48c7bcbb5b5362af4b63d9a1383019a6d
|
|
|
|
|
|
|
|
|
| |
This happened during the abstraction (Idc3ded012890d).
Given that the patch was merged recently,
I don't think we need database patches for it.
Bug: T230428
Change-Id: Ia8c529bc502ed1674476f71f67c80003a2ae83cf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Postges:
- Drop foreign key from 'pp_page'
- Move pk addition from the SQL file to the Updater class
- Override default SQL value for float to return FLOAT which is in use.
For MySQL:
- Override default SQL value for float to return FLOAT which is in use
Hack added in generateSchemaSql.php
Bug: T230428
Bug: T164898
Change-Id: I3c591c9b8f43647b0208690bca79f2d0dd206922
|
|
|
|
|
|
|
|
| |
Indexes need to have prefixes, to avoid clashes in several RDBMSes where
indexes are global
Bug: T266228
Change-Id: I96a04903f6123d1fb8081fcf15cdd1f29708d320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Postgres:
- Drop foreign key from 'revactor_page'
- Change datatype of 'revactor_actor' to BigInt as in MySQL/SQLite
- Make 'revactor_page' non-nullable as in MySQL/SQLite
For MySQL/SQLite:
- Drop empty string default constraint from 'revactor_timestamp' as
this is not allowed in the corresponding PG's TIMESTAMPTZ field
Bug: T230428
Bug: T164898
Change-Id: I8c5c4b338a3000b1e4c2ab82fdae4a9819925868
|
|
|
|
|
|
|
|
|
| |
For Postgres:
- Change 'revcomment_comment_id' to BigInt as it's in MySQL/SQLite
Bug: T230428
Bug: T164898
Change-Id: I4b5af210b63d932e2eb0120075a5fa5250924ace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to make Postgres work:
- Dropped the autoincrement sequence, this is the PK without
autoincrement
- Change ipc_hex from BYTEA to TEXT
- Set default for ipc_rev_id
MySQL/SQLite:
-Drop default for ipc_rev_timestamp
Bug: T230428
Bug: T164898
Change-Id: I7f85d65f6ee3ac8b1d28e33095f37dce81e1727e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Postgres changes:
- Drop foreign key from `el_from`
- Change 'el_index_60 type from BYTEA to TEXT
- Set default for `el_from` to sync with MySQL
- Also renamed these indexes to sync with MySQL
- 'externallinks_from_to' -> 'el_from'
- 'externallinks_index' -> 'el_index'
- Add index 'el_to' on 'el_to' and 'el_from' columns. This completes
the PG indexes to 5 to match up MySQL indexes
Bug: T230428
Bug: T164898
Change-Id: I1ab9bde19e456256db99d1244130e8ee11f9b6c8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Postgres:
- Drop foreign key from pt_title
- Change pt_user to non-nullable to sync with MySQL
- Change pt_expiry to non-nullable to sync with MySQL
- Modify pt_reason_id to use BIGINT to sync with MySQL
- Drop default from pt_create_perm field since MySQL and SQLite
don't have it and the field is not nullable.
-
For MySQL/SQLite:
- Modify pt_title to use varbinary
- Drop DEFAULT constraint from pt_expiry (Postgres already does not have it)
Bug: T230428
Bug: T164898
Change-Id: Iff193754260046222ba9b7e704c46e27f21b1a6b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For MySQL, turning bool to tinyint(1) but doesn't matter because bool is
an alias of tinyint(1)
For Postgres:
- Changing type of iw_prefix and iw_wikiid to varchar(32)
and varchar(64) respectively to make it in sync with Mysql.
- Dropping add_interwiki function, it doesn't serve any purpose (search
didn't bring anything)
Bug: T230428
Bug: T164898
Change-Id: Id652cb544ac1b216f2fad1a8a959739ead8a92cd
|
|
|
|
|
|
|
|
|
|
|
|
| |
For MySQL
- Modify user_last_timestamp from VARBINARY to BINARY
For Postgres
- Drop foreign key on user_id
- Rename indexes to match MySQL convention
Bug: T230428
Change-Id: Idc3ded012890d4ace805a646d75cd805b49b250c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For MySQL/Sqlite, using mwtinyint instead of bool, in reality it doesn't
matter since bool is an alias of tinyint(1) in MySQL.
In Postgres:
- Changing type of site_domain from TEXT to VARCHAR to make it in sync
with MySQL/Sqlite
- Renaming all indexes from site_* to sites_* to be in sync with
MySQL/Sqlite
Bug: T230428
Bug: T164898
Change-Id: Id73bb372807730446901d772fcdbd2f333b397ba
|
|
|
|
|
|
|
|
|
|
|
|
| |
Postgres:
- Set empty string as default for wl_title to match MySQL
- Drop foreign key from wl_user
- Change wl_namespace datatype from SMALLINT to INT to match MySQL/SQLite
- Drop PG-specific indexes and sync them with MySQL
Bug: T230428
Bug: T164898
Change-Id: Ie996b81ca59069443976b90d7bcdce29997d768a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Additional changes for Postgres:
- Set empty string as default for qci_type
- Set PG-equivalent of the given MySql/Sqlite timestamp as
default timestamp for qci_timestamp
- Make qci_type non nullable
- Make qci_timestamp non nullable
- Drop UNIQUE constraint on qci_type
Bug: T230428
Bug: T164898
Depends-On: If344395615087c360597a5b3d66ea03e930b7d9b
Change-Id: I741d2d079696d4b4eba09945341054d2a145bddc
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Postgres:
- Dropping foreign key on ug_user
- Setting default on ug_user and ug_group
- Renaming indexes so they would be the same as MySQL/Sqlite
Bug: T42626
Bug: T164898
Bug: T230428
Change-Id: If507d8b8f363016760fe34aac2a0e0a2d99b66aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sqlite doesn't need any change as binary/varbinary both turn into BLOB.
For Postgres:
- Dropping foreign key on pr_page, as all FKs should be dropped (See
T164898)
- Add all of indexes, it seems PG was missing all four indexes of the
MySQL version and didn't have any
- Changing PK from (pr_page,pr_type) to (pr_id).
- Had to add changePrimaryKey function to handle such cases, similar
to checkIndex
- Set pr_page to not nullable
Bug: T42626
Bug: T164898
Bug: T230428
Change-Id: Ied11f9c2ee633bf5ae325a6c2ea163dcc8d8d3c5
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Yes, name of that table is really querycachetwo.
For migrating MySQL/Sqlite, changed data type of qcc_title and
qcc_titletwo to varbinary.
For migrating Postgres, just renaming indexes to stay in sync with
MySQL/Sqlite was enough.
Bug: T230428
Change-Id: I43952836ce184419622a6f851cb5e9319172d656
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turning qc_title to varbinary in MySQL to make it consistent with the
rest of fields.
For Postgres:
- Setting 0 as default for qc_value and qc_namespace
- Changing data type of qc_namespace from SMALLINT to INT to make it
the same with MySQL/Sqlite
- Renaming index to make it the same with other schemas
- Setting empty string as default of qc_title
Bug: T230428
Bug: T164898
Change-Id: I81527121609014d29182ae735a2c1f532d7d4d2a
|
|
|
|
|
|
|
|
| |
Also dropping the fkey on ir_ipb_id in Postgres as approved by RFC T164898
Bug: T230428
Bug: T164898
Change-Id: Iaddec3b9992eee39fe82a45d5bda59bd51cde510
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also fixing one schema data type drift between MySQL and Postgres
and fixing the problem with booleans, currently DBAL turns "boolean" to
TINYINT(1) in MySQL because it doesn't support it but it leave it like
that in Postgres which in turn breaks it because mediawiki currently
doesn't cast values properly, so for now just turning them to SMALLINT
which is the status quo (See T257755#6335566)
Bug: T230428
Bug: T164898
Change-Id: Ia495a451d51722496942b720a32393f7a6728dee
|
|
|
|
|
|
|
|
|
|
|
|
| |
This takes advantage of custom data type registered in the previous
commit.
Also fixing Postgres drift by dropping the sequence, PK of this table is
not autoincrement so it shouldn't have sequence in Postgres.
Bug: T230428
Bug: T164898
Change-Id: I4c10990ead1e52c979254d2ac6a25ccf62a31508
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
cat_title data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres, renamed two indexes from category_* to cat_* to
make it in sync with MySQL/Sqlite
Bug: T164898
Bug: T230428
Change-Id: Iad11aa4f7d809465cb20ac9748bf52b0e1bcd5a4
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
iwl_title data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres:
- Turning the unique index to PK to make it in sync with MySQL
Bug: T164898
Bug: T230428
Change-Id: Iaa625b66c874023b8cf2403917fa2fa120279208
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
ll_title data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres:
- Dropping foreign key on ll_from
- Setting default of empty string for ll_lang and ll_title
- Make ll_lang and ll_title both non-nullable to be in sync with MySQL
- Turning the unique index to primary key, similar to MySQL
- Renaming an index to sync with MySQL
Bug: T164898
Bug: T230428
Change-Id: I57f22896ff67266f99bf08f6dd1b9cc4c51b1db9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
il_to data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres:
- Dropping foreign key on il_from
- Setting default of empty string for il_to
- Completely rewriting indexes to make it synced with MySQL
Bug: T164898
Bug: T230428
Change-Id: I59f0d0a56d938a168bf1c7de2a1be47f15d1add1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
tl_title data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres:
- Dropping foreign key on tl_from
- Changing data type of tl_namespace from SMALLINT to INT and setting
its default
- Setting default of empty string for tl_title
- Completely rewriting indexes to make it synced with MySQL
Bug: T164898
Bug: T230428
Change-Id: Idbb65d870f58f7146b9c8bd860e6530bef1e0f12
|
|
|
|
|
|
|
|
| |
Put a single blank line between a CREATE TABLE and each accompanying
CREATE INDEX, but two blank lines between those statements and the next
CREATE TABLE.
Change-Id: I8ae8a3c808a772a338e968213031d390bf1b31ca
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a first str_replace() would add a single newline before any
CREATE (TABLE or INDEX), and then a second one would add another newline
after the $wgDBTableOptions, resulting in a blank line between any two
CREATEs and also a newline at the end of the file – at least for MySQL
schemas. But PostgreSQL and SQLite schemas don’t use $wgDBTableOptions,
so the second str_replace() was a no-op for them, and they got no blank
line between CREATEs nor a newline at the end of the file. Fix this by
making the first str_replace() insert two newlines and appending a final
newline all the time.
Bug: T260779
Change-Id: Idcc4fae76d382b559f21234f8a6f49e537a60f11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to migrate MySQL and Sqlite to abstract schema changed the
pl_title data type from varchar binary to varbinary. This wouldn't
affect production.
For migrating Postgres:
- Dropping foreign key on pl_from
- Changing data type of pl_namespace from SMALLINT to INT and setting
its default
- Setting default of empty string for pl_title
- Completely rewriting indexes to make it synced with MySQL
Bug: T164898
Bug: T230428
Change-Id: I4af8202742a1826e6b3f8ff36cf4f7b612b82690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changing "varchar() binary" to varbinary in MySQL and Sqlite for two
columns: rd_title and rd_fragment.
Fixing db drifts of schema in Postgres:
- Setting the data type of rd_namespace from SMALLINT and setting its
default
- Set empty string as default of rd_title
- Changing datatype of rd_interwiki to varchar (PG supports that)
Bug: T164898
Bug: T230428
Change-Id: I9563792b1fc0ce5f3de78c08703a768a0c2e99d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, fixing two data type drifts in Postgres:
- lc_key was varchar (with no binary flag) in MySQL but TEXT in
Postgres while PG supports varchar. Changing PG to varchar.
- lc_value was BYTEA but the rest of varbinary fields are mapped to
TEXT, changing it to TEXT data type.
And fixing primary key of these tables in Postgres too as it was a unique index instead.
Bug: T198811
Bug: T164898
Bug: T230428
Change-Id: I50305556bd870461d05f98c5272cf1d6a65deb15
|
|
|
|
|
|
|
|
|
| |
content.content_id was BIGINT in MySQL (and Sqlite) but INT in Postgres
so making Postgres BIGINT as well.
Bug: T230428
Bug: T164898
Change-Id: Ib8492e224478dc069ba17e489f7b2bb22d5da804
|
|
|
|
|
|
|
|
| |
This is the first table that doesn't have any drift between MySQL and
Postgres.
Bug: T230428
Change-Id: I8be8906fc0f998c8aec79e148487219b3d43e57c
|
|
|
|
|
|
|
|
|
| |
Also ls_value was varchar (with no binary flag) in MySQL but TEXT in
Postgres while PG supports varchar. Changing PG to varchar.
Bug: T230428
Bug: T164898
Change-Id: I2f7fae7b1e781021cb7d3ed39c40c2fc9d20a680
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, dropping foreign key constraint on user_properties.up_user as it's decided to
drop all of foreign key constraints in T164898
And fixing primary key of the table in Postgres as it was a unique index
instead.
Bug: T198811
Bug: T164898
Bug: T230428
Change-Id: I60a2b65df62ec93a363309f8a17c29b83fd6f058
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Six fields were BIGINT in MySQL (and Sqlite) but INT in Postgres
so making Postgres BIGINT as well:
- ss_total_edits
- ss_good_articles
- ss_total_pages
- ss_users
- ss_active_users
- ss_images
Bug: T230428
Bug: T164898
Change-Id: I527b2797af3c8ba1a7402a4428b565f8e35cc132
|
|
|
|
|
|
|
|
|
|
|
|
| |
Three fields were BIGINT in MySQL (and Sqlite) but INT in Postgres
so making Postgres BIGINT as well:
- slot_revision_id
- slot_content_id
- slot_origin
Bug: T230428
Bug: T164898
Change-Id: I5333cc0cbdc36356bd865ae118b883bc367c31eb
|
|
|
|
|
|
|
|
|
| |
comment.comment_id was BIGINT in MySQL (and Sqlite) but INT in Postgres
so making Postgres BIGINT as well.
Bug: T230428
Bug: T164898
Change-Id: I29a1878eea2adfd6e7d8ad85a94dc83718f9671e
|
|
|
|
|
|
|
|
|
| |
bot_passwords.bp_token didn't have a default in Postgres while it has
one in MySQL (and Sqlite), so adding the default to Postgres as well
Bug: T230428
Bug: T164898
Change-Id: I0ae4dbf8f2a5382081c6211c9cad51843000e3f1
|
|
|
|
|
|
|
|
|
|
| |
Also during the abstraction, fixing the schema drift between MySQL
and Postgres in these two tables by removing foreign key, sequences,
and changing data types (as outlined in T164898)
Bug: T230428
Bug: T164898
Change-Id: If737a746629511b5a53d7ae70328fd558bd58d0e
|
|
|
|
|
|
|
|
| |
And converge the schema drift between mysql and postgres by setting all
to binary
Bug: T230428
Change-Id: I6f82b97c6e44c76ccdc0714aa8b32e959fbe896f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And fixing the schema drift between mysql and postgres in this table by
changing field type of ul_key and ul_value from TEXT and TEXT to
VARCHAR(255) and BYTEA respectively.
The automatic generation is done with running generateSchemaSql.php
maintenance script. More info:
https://www.mediawiki.org/wiki/Manual:Schema_changes#Automatically_generated
Bug: T230428
Bug: T164898
Change-Id: Id785539d32546166d6f7a5c3cb1924f4841a2963
|
|
|
|
|
| |
Bug: T230428
Change-Id: I2cb4cab045addd8f532f414923ce323e1bed52f2
|