Implemented basic structure
This commit is contained in:
9
lib/data/db/tables/group_table.dart
Normal file
9
lib/data/db/tables/group_table.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
class GroupTable extends Table {
|
||||
TextColumn get id => text()();
|
||||
TextColumn get name => text()();
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {id};
|
||||
}
|
||||
11
lib/data/db/tables/player_group_table.dart
Normal file
11
lib/data/db/tables/player_group_table.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:game_tracker/data/methods/db/tables/group_table.dart';
|
||||
import 'package:game_tracker/data/methods/db/tables/user_table.dart';
|
||||
|
||||
class PlayerGroupTable extends Table {
|
||||
TextColumn get userId => text().references(UserTable, #id)();
|
||||
TextColumn get groupId => text().references(GroupTable, #id)();
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {userId, groupId};
|
||||
}
|
||||
9
lib/data/db/tables/player_table.dart
Normal file
9
lib/data/db/tables/player_table.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
class PlayerTable extends Table {
|
||||
TextColumn get id => text()();
|
||||
TextColumn get name => text()();
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {id};
|
||||
}
|
||||
Reference in New Issue
Block a user