From 1a7970c9cde134c8112dd5303343324b9a0333e0 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 4 Jul 2019 17:36:59 -0400 Subject: [PATCH] gen --- angel_orm_test/lib/src/models/email_indexed.dart | 7 ++++--- angel_orm_test/lib/src/models/email_indexed.g.dart | 2 +- angel_orm_test/lib/src/models/unorthodox.g.dart | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/angel_orm_test/lib/src/models/email_indexed.dart b/angel_orm_test/lib/src/models/email_indexed.dart index b5e42b3a..3b215365 100644 --- a/angel_orm_test/lib/src/models/email_indexed.dart +++ b/angel_orm_test/lib/src/models/email_indexed.dart @@ -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; -} \ No newline at end of file +} diff --git a/angel_orm_test/lib/src/models/email_indexed.g.dart b/angel_orm_test/lib/src/models/email_indexed.g.dart index 7baebac2..f8fc5422 100644 --- a/angel_orm_test/lib/src/models/email_indexed.g.dart +++ b/angel_orm_test/lib/src/models/email_indexed.g.dart @@ -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'); }); diff --git a/angel_orm_test/lib/src/models/unorthodox.g.dart b/angel_orm_test/lib/src/models/unorthodox.g.dart index 9bcb3fa8..400d5da6 100644 --- a/angel_orm_test/lib/src/models/unorthodox.g.dart +++ b/angel_orm_test/lib/src/models/unorthodox.g.dart @@ -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'); }); }