Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Include system versioned tables for MariaDB #49509

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function compileTables($database)
return sprintf(
'select table_name as `name`, (data_length + index_length) as `size`, '
.'table_comment as `comment`, engine as `engine`, table_collation as `collation` '
."from information_schema.tables where table_schema = %s and table_type = 'BASE TABLE' "
."from information_schema.tables where table_schema = %s and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') "
.'order by table_name',
$this->quoteString($database)
);
Expand Down
17 changes: 17 additions & 0 deletions tests/Integration/Database/SchemaBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,21 @@ public function testGetCompoundForeignKeys()
&& $foreign['foreign_columns'] === ['b', 'a']
));
}

public function testSystemVersionedTables()
{
if ($this->driver !== 'mysql' || ! $this->getConnection()->isMaria()) {
$this->markTestSkipped('Test requires a MariaDB connection.');
}

DB::statement('create table `test` (`foo` int) WITH system versioning;');

$this->assertTrue(Schema::hasTable('test'));

Schema::dropAllTables();

$this->artisan('migrate:install');

DB::statement('create table `test` (`foo` int) WITH system versioning;');
}
}