-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.1.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"db_todo_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"title","getter_name":"title","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"completed","getter_name":"completed","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"completed\" IN (0, 1))","default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// GENERATED CODE, DO NOT EDIT BY HAND. | ||
// ignore_for_file: type=lint | ||
//@dart=2.12 | ||
import 'package:drift/drift.dart'; | ||
import 'package:drift/internal/migrations.dart'; | ||
import 'schema_v1.dart' as v1; | ||
|
||
class GeneratedHelper implements SchemaInstantiationHelper { | ||
@override | ||
GeneratedDatabase databaseForVersion(QueryExecutor db, int version) { | ||
switch (version) { | ||
case 1: | ||
return v1.DatabaseAtV1(db); | ||
default: | ||
throw MissingSchemaException(version, const {1}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// GENERATED CODE, DO NOT EDIT BY HAND. | ||
// ignore_for_file: type=lint | ||
//@dart=2.12 | ||
import 'package:drift/drift.dart'; | ||
|
||
class DbTodoTable extends Table with TableInfo { | ||
@override | ||
final GeneratedDatabase attachedDatabase; | ||
final String? _alias; | ||
DbTodoTable(this.attachedDatabase, [this._alias]); | ||
late final GeneratedColumn<int> id = GeneratedColumn<int>( | ||
'id', aliasedName, false, | ||
hasAutoIncrement: true, | ||
type: DriftSqlType.int, | ||
requiredDuringInsert: false, | ||
defaultConstraints: | ||
GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); | ||
late final GeneratedColumn<String> title = GeneratedColumn<String>( | ||
'title', aliasedName, false, | ||
type: DriftSqlType.string, requiredDuringInsert: true); | ||
late final GeneratedColumn<bool> completed = GeneratedColumn<bool>( | ||
'completed', aliasedName, false, | ||
type: DriftSqlType.bool, | ||
requiredDuringInsert: true, | ||
defaultConstraints: | ||
GeneratedColumn.constraintIsAlways('CHECK ("completed" IN (0, 1))')); | ||
@override | ||
List<GeneratedColumn> get $columns => [id, title, completed]; | ||
@override | ||
String get aliasedName => _alias ?? actualTableName; | ||
@override | ||
String get actualTableName => $name; | ||
static const String $name = 'db_todo_table'; | ||
@override | ||
Set<GeneratedColumn> get $primaryKey => {id}; | ||
@override | ||
Never map(Map<String, dynamic> data, {String? tablePrefix}) { | ||
throw UnsupportedError('TableInfo.map in schema verification code'); | ||
} | ||
|
||
@override | ||
DbTodoTable createAlias(String alias) { | ||
return DbTodoTable(attachedDatabase, alias); | ||
} | ||
} | ||
|
||
class DatabaseAtV1 extends GeneratedDatabase { | ||
DatabaseAtV1(QueryExecutor e) : super(e); | ||
late final DbTodoTable dbTodoTable = DbTodoTable(this); | ||
@override | ||
Iterable<TableInfo<Table, Object?>> get allTables => | ||
allSchemaEntities.whereType<TableInfo<Table, Object?>>(); | ||
@override | ||
List<DatabaseSchemaEntity> get allSchemaEntities => [dbTodoTable]; | ||
@override | ||
int get schemaVersion => 1; | ||
} |