platform/angel_orm_generator/test/models/book.migration.g.dart
2017-11-18 15:12:30 -05:00

25 lines
704 B
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// Generator: MigrationGenerator
// **************************************************************************
import 'package:angel_migration/angel_migration.dart';
class BookMigration extends Migration {
@override
up(Schema schema) {
schema.create('books', (table) {
table.serial('id')..primaryKey();
table.varchar('name');
table.timeStamp('created_at');
table.timeStamp('updated_at');
table.integer('author_id').references('authors', 'id').onDeleteCascade();
});
}
@override
down(Schema schema) {
schema.drop('books');
}
}