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
@orm
abstract class _User {
@PrimaryKey(columnType: ColumnType.varChar)
String get email;
// @PrimaryKey(columnType: ColumnType.varChar)
@primaryKey
String get email;
String get name;
String get password;
@ManyToMany(_RoleUser)
List<_Role> get roles;
}
}

View file

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

View file

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