Postgres:
- Drop foreign key from rev_page
- Make rev_page not nullable
- Change rev_comment_id from int to bigint
- Change rev_actor from int to bigint
- Sync rev_page_id index with MySQL
MySQL/SQlite:
- Drop default from rev_timestamp
Additional changes in the generator script to handle more
formatting issues due to use of additional custom table options
Bug: T230428
Bug: T164898
Change-Id: Ia07dd52e43123473a1728523a3f863280537db8e
Adding it (only to be removed later) is not useful and interferes with
the internals of the schema builder because it masks the actual table
name during the table sql building and at some stages, this actual name
is required to be known
Bug: T191231
Change-Id: I57cc9b83c81f5c2d0d50c7b9e0dc334e7251c74f
Subclass DBAL\Platforms\MySqlPlatform so that we can override
methods cleanly. Move the current MySQL hack from the schema
generator script to this class.
If 'float' is specified in the json spec without any option, the
FLOAT data type will be used. To use DOUBLE PRECISION (aka REAL)
a 'doublePrecision' option has to be specified and set to true.
No support for specifying arbitrary precision since no current
table is using that and the feature is deprecated in MySQL 8 anyway
Due to T270740, the subclassing is not straightforward because
the base DBAL MySqlPlatform class is renamed in DBAL 3.0.0. For
now a compatibility intermediate class is used as in PG subclass
Other changes: Use switch instead of if/else and remove brackets
in instantiating a class without arguments.
Bug: T191231
Change-Id: I9a5087b1e2afc2b63e30d67ea2ca616f047a0258
Mere presence of partial index's WHERE clause is disrupting anything
that comes after it leading to strange and non-uniform formatting
Change-Id: I068113b3026d6c3422348e86b3048234b905bb1d
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
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
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
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
Currently, Postgres just ignores the table prefix and in order to avoid
breaking existing installations, we remove them for now until we find a
better solution.
The documentation explicitly says that setting $wgDBprefix wouldn't
work on Postgres. And the current manual schema doesn't have it at all.
Bug: T230428
Change-Id: Ic6a3469ea3893b0166f108f2252f63827bfaaccb
This helps preventing mistakes, for example if you don't know or you
forget to generate the sql schema for one or all of them.
Also it helps preventing malicious changes to the generated files that
might go in without much scrutiny as the manual files.
Bug: T252919
Change-Id: I50e2715a55914f7712f9925c149bd09e8265a20b