mirror of https://github.com/AMT-Cheif/drift.git
22 lines
519 B
Dart
22 lines
519 B
Dart
import 'package:drift/drift.dart';
|
|
|
|
part 'database.g.dart';
|
|
|
|
class Users extends Table {
|
|
IntColumn get id => integer().autoIncrement()();
|
|
TextColumn get name => text()();
|
|
DateTimeColumn get createdAt =>
|
|
dateTime().nullable().withDefault(currentDateAndTime)();
|
|
}
|
|
|
|
@DriftDatabase(tables: [Users])
|
|
class Database extends _$Database {
|
|
Database.connect(DatabaseConnection c) : super.connect(c);
|
|
|
|
@override
|
|
int get schemaVersion => 1;
|
|
|
|
@override
|
|
DriftDatabaseOptions options = DriftDatabaseOptions();
|
|
}
|