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 /tests/phpunit/integration/includes | |
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 'tests/phpunit/integration/includes')
-rw-r--r-- | tests/phpunit/integration/includes/db/DatabaseSqliteTest.php | 2 | ||||
-rw-r--r-- | tests/phpunit/integration/includes/db/DatabaseSqliteUpgradeTest.php | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php b/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php index 9ee4518baa5d..ef30c378cb2e 100644 --- a/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php @@ -263,7 +263,7 @@ class DatabaseSqliteTest extends \MediaWikiIntegrationTestCase { public function testEntireSchema() { global $IP; - $result = Sqlite::checkSqlSyntax( "$IP/maintenance/sqlite/tables-generated.sql" ); + $result = Sqlite::checkSqlSyntax( "$IP/sql/sqlite/tables-generated.sql" ); $this->assertTrue( $result, $result ); } diff --git a/tests/phpunit/integration/includes/db/DatabaseSqliteUpgradeTest.php b/tests/phpunit/integration/includes/db/DatabaseSqliteUpgradeTest.php index b00f2b9047d5..792fac59ea84 100644 --- a/tests/phpunit/integration/includes/db/DatabaseSqliteUpgradeTest.php +++ b/tests/phpunit/integration/includes/db/DatabaseSqliteUpgradeTest.php @@ -77,7 +77,7 @@ class DatabaseSqliteUpgradeTest extends \MediaWikiIntegrationTestCase { * @coversNothing */ public function testEntireSchema() { - $result = Sqlite::checkSqlSyntax( dirname( __FILE__, 6 ) . "/maintenance/tables.sql" ); + $result = Sqlite::checkSqlSyntax( dirname( __FILE__, 6 ) . "/sql/sqlite/tables-generated.sql" ); if ( $result !== true ) { $this->fail( $result ); } @@ -184,8 +184,7 @@ class DatabaseSqliteUpgradeTest extends \MediaWikiIntegrationTestCase { $updater = DatabaseUpdater::newForDB( $db, false, $maint ); $updater->doUpdates( [ 'core' ] ); } else { - $db->sourceFile( dirname( __FILE__, 6 ) . "/maintenance/tables.sql" ); - $db->sourceFile( dirname( __FILE__, 6 ) . "/maintenance/sqlite/tables-generated.sql" ); + $db->sourceFile( dirname( __FILE__, 6 ) . "/sql/sqlite/tables-generated.sql" ); } return $db; |