This commit is contained in:
Tobe O 2019-07-04 17:36:59 -04:00
parent e4a45c47ba
commit 1a7970c9cd
3 changed files with 10 additions and 9 deletions

View file

@ -29,11 +29,12 @@ abstract class _RoleUser {
@serializable @serializable
@orm @orm
abstract class _User { abstract class _User {
@PrimaryKey(columnType: ColumnType.varChar) // @PrimaryKey(columnType: ColumnType.varChar)
String get email; @primaryKey
String get email;
String get name; String get name;
String get password; String get password;
@ManyToMany(_RoleUser) @ManyToMany(_RoleUser)
List<_Role> get roles; List<_Role> get roles;
} }

View file

@ -43,7 +43,7 @@ class UserMigration extends Migration {
@override @override
up(Schema schema) { up(Schema schema) {
schema.create('users', (table) { schema.create('users', (table) {
table.declare('email', ColumnType('varchar'))..primaryKey(); table.varChar('email')..primaryKey();
table.varChar('name'); table.varChar('name');
table.varChar('password'); table.varChar('password');
}); });

View file

@ -24,7 +24,7 @@ class WeirdJoinMigration extends Migration {
@override @override
up(Schema schema) { up(Schema schema) {
schema.create('weird_joins', (table) { schema.create('weird_joins', (table) {
table.declare('id', ColumnType('serial'))..primaryKey(); table.integer('id')..primaryKey();
table table
.declare('join_name', ColumnType('varchar')) .declare('join_name', ColumnType('varchar'))
.references('unorthodoxes', 'name'); .references('unorthodoxes', 'name');
@ -59,7 +59,7 @@ class NumbaMigration extends Migration {
@override @override
up(Schema schema) { up(Schema schema) {
schema.create('numbas', (table) { schema.create('numbas', (table) {
table.declare('i', ColumnType('serial'))..primaryKey(); table.integer('i')..primaryKey();
table.integer('parent'); table.integer('parent');
}); });
} }
@ -74,7 +74,7 @@ class FooMigration extends Migration {
@override @override
up(Schema schema) { up(Schema schema) {
schema.create('foos', (table) { schema.create('foos', (table) {
table.declare('bar', ColumnType('serial'))..primaryKey(); table.varChar('bar')..primaryKey();
}); });
} }
@ -89,9 +89,9 @@ class FooPivotMigration extends Migration {
up(Schema schema) { up(Schema schema) {
schema.create('foo_pivots', (table) { schema.create('foo_pivots', (table) {
table table
.declare('weird_join_id', ColumnType('serial')) .declare('weird_join_id', ColumnType('int'))
.references('weird_joins', 'id'); .references('weird_joins', 'id');
table.declare('foo_bar', ColumnType('serial')).references('foos', 'bar'); table.declare('foo_bar', ColumnType('varchar')).references('foos', 'bar');
}); });
} }