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

[11.x] Improve readability of SQLite schema dumps #52172

Merged
merged 10 commits into from
Jul 18, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Simplify test
  • Loading branch information
bakerkretzmar committed Jul 17, 2024
commit ff9667621494b875cfe6a48dc9d934c3ce6e8977
9 changes: 2 additions & 7 deletions tests/Integration/Database/Sqlite/SchemaStateTest.php
Original file line number Diff line number Diff line change
@@ -26,12 +26,9 @@ public function testSchemaDumpOnSqlite()
$connection->getSchemaBuilder()->createDatabase($connection->getConfig('database'));

$connection->statement('CREATE TABLE users(id integer primary key autoincrement not null, email varchar not null, name varchar not null);');
$connection->statement('CREATE UNIQUE INDEX users_email_unique on users (email);');
$connection->statement('INSERT INTO users (email, name) VALUES ("taylor@laravel.com", "Taylor Otwell");');

$connection->statement('PRAGMA optimize;');

$this->assertTrue($connection->table('sqlite_stat1')->exists());
$this->assertTrue($connection->table('sqlite_sequence')->exists());

$this->app['files']->ensureDirectoryExists(database_path('schema'));

@@ -40,10 +37,8 @@ public function testSchemaDumpOnSqlite()
$this->assertFileContains([
'CREATE TABLE users',
], 'database/schema/sqlite-schema.sql');
$this->assertFileDoesNotContains([
$this->assertFileNotContains([
'sqlite_sequence',
'sqlite_stat1',
'sqlite_stat4',
], 'database/schema/sqlite-schema.sql');
}
}