mirror of https://github.com/AMT-Cheif/drift.git
Fix schema tests
We don't support executors changing their dialect at runtime.
This commit is contained in:
parent
4912bad292
commit
dc595eb3a2
|
@ -109,20 +109,26 @@ void main() {
|
|||
[]));
|
||||
});
|
||||
|
||||
test('creates tables with custom types', () async {
|
||||
await db.createMigrator().createTable(db.withCustomType);
|
||||
group('creates tables with custom types', () {
|
||||
test('sqlite3', () async {
|
||||
await db.createMigrator().createTable(db.withCustomType);
|
||||
|
||||
verify(mockExecutor.runCustom(
|
||||
'CREATE TABLE IF NOT EXISTS "with_custom_type" ("id" text NOT NULL);',
|
||||
[]));
|
||||
verify(mockExecutor.runCustom(
|
||||
'CREATE TABLE IF NOT EXISTS "with_custom_type" ("id" text NOT NULL);',
|
||||
[]));
|
||||
});
|
||||
|
||||
when(mockExecutor.dialect).thenReturn(SqlDialect.postgres);
|
||||
await db.createMigrator().createTable(db.withCustomType);
|
||||
verify(mockExecutor.runCustom(
|
||||
'CREATE TABLE IF NOT EXISTS "with_custom_type" ("id" uuid NOT NULL);',
|
||||
[]));
|
||||
test('postgres', () async {
|
||||
when(mockExecutor.dialect).thenReturn(SqlDialect.postgres);
|
||||
await db.createMigrator().createTable(db.withCustomType);
|
||||
verify(mockExecutor.runCustom(
|
||||
'CREATE TABLE IF NOT EXISTS "with_custom_type" ("id" uuid NOT NULL);',
|
||||
[]));
|
||||
});
|
||||
});
|
||||
|
||||
test('creates tables with custom types', () async {});
|
||||
|
||||
test('creates views through create()', () async {
|
||||
await db.createMigrator().create(db.categoryTodoCountView);
|
||||
|
||||
|
|
Loading…
Reference in New Issue