aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/postgres/archives
Commit message (Collapse)AuthorAgeFilesLines
...
* Migrate categorylinks to abstract schemaAmir Sarabadani2020-12-031-0/+3
| | | | | | | | | | | | | | | | | 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
* Merge "Start generateSchemaChangeSql.php"jenkins-bot2020-11-161-9/+10
|\
| * Start generateSchemaChangeSql.phpAmir Sarabadani2020-11-011-9/+10
| | | | | | | | | | | | | | | | Creating schema changes from abstract schema and even abstracting a schema change. Bug: T230420 Change-Id: If626e866642af820dd70c5f9b0fe7c6a951e0a25
* | Migrate querycache_info to abstract schemaAmmar Abdulhamid2020-10-201-0/+3
|/ | | | | | | | | | | | | | | 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
* Migrate iwlinks to abstract schemaAmir Sarabadani2020-09-051-0/+8
| | | | | | | | | | | | | 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
* Migrate langlinks to abstract schemaAmir Sarabadani2020-09-051-0/+3
| | | | | | | | | | | | | | | | | 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
* Merge "Migrate l10n_cache and module_deps to abstract schema"jenkins-bot2020-08-092-0/+6
|\
| * Migrate l10n_cache and module_deps to abstract schemaAmir Sarabadani2020-08-062-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix DROP CONSTRAINT for interwiki.iw_prefix PostgreSQL patchGergő Tisza2020-08-081-2/+2
| | | | | | | | | | | | | | | | This partialy reverts commit 9e9414db50870422e1960330a02bc69ce0435851. DROP CONSTRAINT is part of ALTER TABLE in PostgreSQL, not a stadalone command. Change-Id: Ifd1b4235ea3b94d130fa3a89739af68a6db820f7
* | Fix primary key sql patches of PostgresAmir Sarabadani2020-08-072-3/+3
|/ | | | | | | | | | | | | | Out of six PK SQL patches for Postgres, two of them were broken because you can't put drop index inside alter table: http://sqlfiddle.com/#!17/2acf44/1 One of them were caused by yours truly copying from the other one. Also fixing file name in one the pk patches. Noticed in I60a2b65d Change-Id: If793ea61437d46adf3e05c38df4ad37bce81c5cf
* Migrate user_properties to abstract schemaAmir Sarabadani2020-07-311-0/+3
| | | | | | | | | | | | | 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
* Create new table for watchlist expiryMusikAnimal2020-02-071-0/+8
| | | | | | | | This table will store expiries for watchlist items, so that pages can be automatically unwatched at a specific time. Bug: T240094 Change-Id: I014ffccb91969e7a222a83858c55e71067b0f2af
* Postgres: Add PK to `redirect` tableBrad Jorsch2019-11-271-0/+1
| | | | | | Apparently when the PG schema was created, this PK was overlooked. Change-Id: I208f03d7b3f768691905081244193bad4b789175
* Merge "Remove traling double newlines from text files"jenkins-bot2019-11-0712-13/+0
|\
| * Remove traling double newlines from text filesFomafix2019-10-2312-13/+0
| | | | | | | | | | | | | | | | | | | | Performed using: git ls-files \*.json \*.php \*.xml \*.xsd \*.html \*.txt \*.sql | xargs sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' Excluded tests/parser/preprocess. Change-Id: I513538ff13c942acfe589f15c5128a8df2b3ace9
* | profiler: Remove ProfilerOutputDb and profileinfo.php entry pointTimo Tijhof2019-11-061-8/+0
|/ | | | | Bug: T231366 Change-Id: I211c8192200d9af00914f9847608a6daf2898f91
* Split down patch-actor-table.sqlReedy2019-09-302-12/+11
| | | | | Bug: T227662 Change-Id: I024ff1d6f4c2726242138ba7e7f19480d9d2b948
* Split down patch-comment-table.sqlReedy2019-08-203-15/+13
| | | | | Bug: T227662 Change-Id: I7617616df57f7468d06e9b52426b6851bfef0e7d
* Clean ups of dropping tag_summary tableAmir Sarabadani2018-12-191-9/+0
| | | | Change-Id: I92dc906d0dfd870e6b77671e5d7cfd3f56090325
* Drop tag_summary and valid_tag tablesAmir Sarabadani2018-12-181-3/+0
| | | | | Bug: T209525 Change-Id: I153607239145a772f5ea47eefd3340096a494b4b
* Drop ct_tag column from change_tag tableAmir Sarabadani2018-11-281-0/+10
| | | | | Bug: T194163 Change-Id: I05d43510b51a67733b0107f0a768e261fe8ddabd
* Make Schema changes for Partial BlocksDavid Barratt2018-09-071-0/+11
| | | | | | | | | Update the database schema so a block can be switched between a sitewide and partial block. Also add the restrictions table for specifiying the partial blocks. Bug: T197144 Change-Id: I4a725312c4b980a1b14e5ca826069fa2278a5913
* Fix table prefixing in patch-change_tag-change_tag_rc_tag_id.sqlReedy2018-09-061-2/+2
| | | | | Change-Id: Id1963e93a43d4b183a31788b645c83e3037f3016 Follows-up: I24609c57e47308d1330a97527f4ea374d0d307ba
* Schema change for reading ct_tag_id instead of ct_tagAmir Sarabadani2018-09-041-0/+16
| | | | | | | Adding unique index on ct_tag_id and making indexes on ct_tag non unique Bug: T193874 Change-Id: I24609c57e47308d1330a97527f4ea374d0d307ba
* Convert numerous UNIQUE INDEX to PRIMARY KEYReedy2018-07-113-0/+7
| | | | | | | | | | | | | | | | | MySQL, SQLite, PostgreSQL and MSSQL done with transitional patches. One additional duplicate index removed from PostgreSQL schema. Having a PK is essential to do maintenance, specially on large tasks. By not having a PK it is impossible to add it in a safe way if not done directly on the master. Having a PK means that we can easily change the PK into another one if needed in the future. The ones we chose might not be the best ones, but will allow us to get them changed. Bug: T198811 Change-Id: I6b96a427687085c6c24bcd759c9739f81288b919
* Introduce change_tag_def tableAmir Sarabadani2018-05-081-0/+14
| | | | | | | | | Table defining tag names for IDs. Also stores hit counts to avoid expensive queries on change_tag See T185355 for more information Bug: T193867 Bug: T185355 Change-Id: I4fd943589b3ed304471304c8beda15327a8edbcf
* Fix typo in postgres patch-drop-ar_text.sqlBrad Jorsch2018-04-261-1/+1
| | | | Change-Id: I6d479d123848325b8501275ef4b98fc81cd99505
* Merge "Drop archive.ar_text and ar_flags"jenkins-bot2018-04-231-0/+8
|\
| * Drop archive.ar_text and ar_flagsBrad Jorsch2018-04-031-0/+8
| | | | | | | | | | | | | | | | | | | | This should have been done long ago. Now it is being done. This also changes ar_text_id to NOT NULL, since it should never be null anymore, and DEFAULT 0 in preparation for MCR stopping writing it. Bug: T33223 Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
* | rdbms: Remove support for PostgreSQL < 9.2, and improve INSERT IGNORE for 9.5Brad Jorsch2018-04-051-2/+2
|/ | | | | | | | | | | | | MediaWiki doesn't support PostgreSQL < 9.2, so drop the support for older versions. At the same time, since we're messing with the DatabasePostgres::insert() code anyway, let's start using ON CONFLICT DO NOTHING for PG >= 9.5. And since we're doing that, let's do the same for DatabasePostgres::nativeInsertSelect(). Change-Id: I7bf13c3272917ebafeaff11eb116714a099afdf3
* Populate ar_rev_id and make it non-nullableBrad Jorsch2018-04-021-0/+3
| | | | | | | | | | | | Revisions deleted before MediaWiki 1.5 do not have a value in this field. This is going to be a problem for migration to the MCR schema, so provide a maintenance script to clean this up. Then, for good measure, change the schema to make the field non-nullable. Bug: T182678 Change-Id: Ie2e11f12a30f379db32c3e074658012c6f93adb0
* Overhaul site_stats tableEddie Greiner-Petter2018-03-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | The site stats table holds a bunch of metric fields, two of which are of data type "bigint unsigned", 3 are "bigint" (signed) and one is int (signed). Also the default values differ widely: It is 0 on the "unsigned" fields and the "int" field, but -1 on the three others. This patch makes all of this more consistent: Set all fields (except the ss_row_id, which isn't changed) data type to "bigint unsigned". Also set NULL as the default value for all those fields. Obviously -1 isn't a possible default value any more. Also, 0 can easily be mistaken for a real value (e.g. ss_active_users=0 --> "there is nobody active on this wiki"). NULL, by it's definition, is the value of choice for a value to insert into fields of which we don't know a correct value. The respective patch files were tested locally against MySql, Sqlite, Postgres and SQL Server 2016. Neither oracle nor the upgrade with update.php was tested. Bug: T56888 Change-Id: I7d42aae434852a56b6f8dd559d8a5f3bce416021
* MCR: replace slot_inherited with slot_origindaniel2018-03-191-2/+2
| | | | | Bug: T189004 Change-Id: Ie9dbda3296a71f584c82a5f275098adc225a53d5
* Add `actor` table and code to start using itBrad Jorsch2018-02-231-0/+24
| | | | | | | | | | | | | Storing the user name or IP in every row in large tables like revision and logging takes up space and makes operations on these tables slower. This patch begins the process of moving those into one "actor" table which other tables can reference with a single integer field. A subsequent patch will remove the old columns. Bug: T167246 Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50 Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
* MCR database schemadaniel2017-12-234-0/+31
| | | | | | | | | | | | | | | Schema additions/updates for MySQL, SQLite, PostgreSQL, MSSQL and Oracle to add new tables: * content * content_models * slots * slot_roles See also https://www.mediawiki.org/wiki/Multi-Content_Revisions/Database_Schema Bug: T174028 Change-Id: I30a3a9834d54d0e6957553d91908b2b73b2c802f
* Remove DEFAULT '' from postgres ip_changes.ipc_rev_timestampReedy2017-11-291-1/+1
| | | | | | | Follows-up Ic11c64813ee04e8520771bfa156f8e51404273e7 Bug: T181672 Change-Id: I58fe5edb1e7656773271634f702ed044c6036497
* Add SQL for postgres, and fail gracefully in populateIpChangesMusikAnimal2017-11-291-0/+10
| | | | | | | | | | If the ip_changes table doesn't exist, the populateIpChanges maintenance script will fail gracefully, throwing a descriptive error. The postgres SQL is untested. Bug: T177258 Change-Id: Ic11c64813ee04e8520771bfa156f8e51404273e7
* Add primary keys to site_statsEddie Greiner-Petter2017-10-171-0/+3
| | | | | | | | | | | | | As discussed in I7d42aae434852a56b6f8dd559d8a5f3bce416021 primary keys are needed to perform various schema changes on the site_stats table. This patch aims to introduce primary keys for all supported dbms. The respective *.sql patch files were tested locally against Postgres and SQL Server 2016. Please note that neither the patch file for Oracle DB nor the mediawiki upgrade through update.php was tested. Bug: T56888 Change-Id: Id10e221f0dc120bc09afc22596fd1dbecbf6a61d
* Fix PostgreSQL patch-add-3d.sql by replacing itBrad Jorsch2017-10-121-1/+0
| | | | | | | | | | | | | | | Follows-up 6260545fee, a2f5d05ae8. (T157348) If updates are run for the first time on an installation that already has '3D' in the enum (e.g. because it's a fresh install), the update fails. Instead of blindly running a patch file, we instead add a method that checks whether the enum type already contains the value before adding it. Bug: T177417 Change-Id: Iad10cb88cf1cb35cfb95ce98a556b33688158a88
* Fix various PostgreSQL failuresBrad Jorsch2017-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | * Fix schema for image_comment_temp. * Provide values in CommentStoreTest::provideInsertRoundTrip() for columns where the PG schema doesn't have a default value but the MySQL schema does. * Call nextSequenceValue() from CommentStoreTest::testInsertRoundTrip(). * Correctly handle $options being the string 'FOR UPDATE' in DatabasePostgres::selectSQLText() * Correctly handle the initial table in DatabasePostgres::selectSQLText() FOR UPDATE mangling. * Correctly handle aliases in DatabasePostgres::selectSQLText() FOR UPDATE mangling. Tests in PG are still going to be broken thanks to the fact that nextSequenceValue() and insertId() can't be separated by another nextSequenceValue()/insertId() pair. That should be taken care of by T164898/T164900. Change-Id: Ia770a003ca9170ab8bcc1436d8afe30700e00ada
* Fix index in PostgreSQL schemaBrad Jorsch2017-08-301-1/+1
| | | | | | Followup to Ic3a434c06 Change-Id: I68966726f91b1854e845b2a0757b599644749b4f
* Add `comment` table and code to start using itBrad Jorsch2017-08-301-0/+27
| | | | | | | A subsequent patch will remove the old columns. Bug: T166732 Change-Id: Ic3a434c061ed6e443ea072bc62dda09acbeeed7f
* Follow-up to '3D' file type additionMatthias Mullie2017-07-281-0/+1
| | | | | | | Based on feedback on Id78a504302fa664b353a4c45bdc5d99f95a0180a Bug: T157348 Change-Id: Id6bfe8d20307f62e4673a5ef30e79f164b1ea034
* Revert "Remove SessionManager, temporarily"Brad Jorsch2016-02-031-0/+9
| | | | | | This reverts commit 823db5d63dd5200d04c63da50ba6bf16f928e70b. Change-Id: Ibb3e023e4eb6715295586dea87d0725c344a8271
* Remove SessionManager, temporarilyBrad Jorsch2016-02-011-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plan here is to take it out of 1.27.0-wmf.12 and put it back in 1.27.0-wmf.13. Since BotPasswords depends on SessionManager, that's getting temporarily removed too. This reverts the following commits: * 6acd424e0dbc322e8b9a141bd2625453c1b9b6f1 SessionManager: Notify AuthPlugin before calling hooks * 4d1ad32d8acbd443346253d2f6a95024c833295c Close a loophole in CookieSessionProvider * fcdd643a46d87b677f6cdcc3ba9440e1472d8df7 SessionManager: Don't save non-persisted sessions to backend storage * 058aec4c76129b7ee8541692a8a48f8046e15bb6 MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php * b5c0c03bb708f8dad6e404969df8addc123984db SessionManager: Save user name to metadata even if the user doesn't exist locally * 13f2f09a193215aa7a061d10a1955e172d06fa0a SECURITY: Fix User::setToken() call on User::newSystemUser * 305bc75b27903237a9683ec1f329bcbec0ecd266 SessionManager: Don't generate user tokens when checking the tokens * 7c4bd85d2152fd9fa975ea0fb5ffb1a0b804f99b RequestContext::exportSession() should only export persisted session IDs * 296ccfd4a9a6ad3ae412db7e2408c923aaa61f64 SessionManager: Save 'persisted' flag in session metadata * 94ba53f67731b0553a6178841d9506e384f74496 Move CSRF token handling into MediaWiki\Session\Session * 46a565d6b00174e631d2022b47677e1a78e73897 Avoid false "added in both Session and $_SESSION" when value is null * c00d0b5d94c946b8883dd7062bf7160a199aa5c2 Log backtrace for "User::loadFromSession called before the end of Setup.php" * 4eeff5b559e2ae7b8fa1f45572968ba28573a421 Use $wgSecureCookie to decide whether to actually mark secure cookies as 'secure' * 7491b52f700e220814a8190781fd794b4dd88a20 Call session_cache_limiter() before starting a session * 2c34aeea72471f9a598e67bdbf34bc5f9fb3f0c5 SessionManager: Abstract forceHTTPS cookie setting * 9aa53627a53aabec0273cecf45a86e77927ef406 Ignore auth cookies with value 'deleted' * 43f904b51a746d7f71ea2ab9951c5c98d269765b SessionManager: Kill getPersistedSessionId() * 50c52563528ba3d765c3762211f98d6f3c0e39fd SessionManager: Add SessionBackend::setProviderMetadata() * f640d403154bc0a2b4f6d399582797a9e3bc6fcb SessionManager: Notify AuthPlugin when auto-creating accounts * 70b05d1ac1e859bac2185b246e9b93ec9051e4d8 Add checks of $wgEnableBotPasswords in more places * bfed32eb78b6c720b16bc7ed60153fd2fe257a9e Do not raise a PHP warning when session write fails * 722a7331ad8d98228511f8da38adc7a3c64dd617 Only check LoggedOut timestamp on the user loaded from session * 4f5057b84b36eccd16627a6b29831dfdb4483b02 SessionManager: Change behavior of getSessionById() * 66e82e614e157e39b03d813e71ddf23f53cf640b Fix typo in [[MediaWiki:Botpasswords-editexisting/en]] * f9fd9516d922d36291037baca7205a2b0ac9f15f Add "bot passwords" * d7716f1df0b692902571bf415a0984071e3e9a60 Add missing argument for wfDebugLog * a73c5b7395a07d490f7052fd3b2491ebd656b190 Add SessionManager Change-Id: I2389a8133e25ab929e9f27f41fa9a05df8147a50
* Add "bot passwords"Brad Jorsch2016-01-121-0/+9
| | | | | | | | | | | | | | | | Bot passwords are something like OAuth-lite, or Google's application passwords: the bot can use API action=login to log in with the special username and password, and will then be allowed to use the API with a restricted set of rights. This is intended to provide an easy migration path for legacy bots and for bots on wikis without OAuth, since AuthManager is going to greatly complicate non-interactive authentication. If OAuth is available, an owner-only consumer would be a better choice. Bug: T121113 Change-Id: Iaa4015e00edbfbfaedcc8b2d27a2d3fd25009159 Depends-On: I7e15331efb162275c4116bcae61f19d6b884cbe3
* resourceloader: Remove obsolete msg_resource database tableTimo Tijhof2015-12-141-8/+0
| | | | | | No longer used as of 5d5b269e0e63641f3. Change-Id: Ieb8448185cf39aa396e902e025e673f0886ac3c3
* resourceloader: Remove obsolete msg_resource_links tableTimo Tijhof2015-12-141-6/+0
| | | | | | No longer used as of Ia9131f570. Change-Id: If009e2620e59002e127d21b90a96bdd29e5d2a9d
* PostgreSQL: Fix text search on moved pagesJeff2015-02-171-0/+5
| | | | | | | | | | | | | | | When a page is updated under PostgreSQL, there is code to de-index all but the most recent version of the page. But when a page is moved, it was accidentally de-indexing the most recent version as well, because rev_text_id is not incremented in that case. A simple tweak to the SQL fixes that. I added code to the update script to find pages previously corrupted by this problem and reindex them. Bug: 66650 Change-Id: I52e1bbbd8592be5e7c7383c225e6b4c19bbe5b9e
* In maintenance/postgres/tables.sql, the profiling table should be defined likeJeff Janes2013-10-151-1/+2
| | | | | | | | | | | | | | | | | | | this: CREATE TABLE profiling ( pf_count INTEGER NOT NULL DEFAULT 0, pf_time FLOAT NOT NULL DEFAULT 0, pf_memory FLOAT NOT NULL DEFAULT 0, pf_name TEXT NOT NULL, pf_server TEXT NULL ); The current use of NUMERIC(18,10) very rapidly overflows the pf_memory column, generating errors. Also, the NUMERIC is very much slower than float, and in this case it has no advantages. Bug: 55722 Change-Id: I48b00d55aaed821a4ceb9365033817a3b477d71a