Destroy sample migrations
This commit is contained in:
parent
cdf1fdc9c3
commit
1e084ec4d6
4 changed files with 0 additions and 46 deletions
|
@ -1,19 +0,0 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'package:furlong/furlong.dart';
|
|
||||||
|
|
||||||
class GroupMigration extends Migration {
|
|
||||||
String get name => "Groups table";
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future create(Migrator migrator) async {
|
|
||||||
migrator.create("groups", (table) {
|
|
||||||
table.id();
|
|
||||||
table.varChar("name");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future destroy(Migrator migrator) async {
|
|
||||||
migrator.drop(["groups"]);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,8 +6,6 @@ import 'package:angel_configuration/angel_configuration.dart';
|
||||||
import 'package:angel_framework/angel_framework.dart';
|
import 'package:angel_framework/angel_framework.dart';
|
||||||
import 'package:furlong/furlong.dart';
|
import 'package:furlong/furlong.dart';
|
||||||
import 'package:sqljocky/sqljocky.dart';
|
import 'package:sqljocky/sqljocky.dart';
|
||||||
export 'group.dart';
|
|
||||||
export 'todo.dart';
|
|
||||||
|
|
||||||
Future<ConnectionPool> createPool() async {
|
Future<ConnectionPool> createPool() async {
|
||||||
var app = new Angel();
|
var app = new Angel();
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'package:furlong/furlong.dart';
|
|
||||||
|
|
||||||
class TodoMigration extends Migration {
|
|
||||||
String get name => "Todos table";
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future create(Migrator migrator) async {
|
|
||||||
migrator.create("todos", (table) {
|
|
||||||
table.id();
|
|
||||||
table.varChar("group_id").nullable = true;
|
|
||||||
table.varChar("title").nullable = true;
|
|
||||||
table.varChar("text");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future destroy(Migrator migrator) async {
|
|
||||||
migrator.drop(["todos"]);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +1,9 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:io';
|
|
||||||
import 'package:angel/migrations/migrations.dart';
|
import 'package:angel/migrations/migrations.dart';
|
||||||
import 'package:furlong/furlong.dart';
|
import 'package:furlong/furlong.dart';
|
||||||
import 'package:grinder/grinder.dart';
|
import 'package:grinder/grinder.dart';
|
||||||
|
|
||||||
final List<Migration> migrations = [
|
final List<Migration> migrations = [
|
||||||
// Your migrations here!
|
// Your migrations here!
|
||||||
new GroupMigration(),
|
|
||||||
new TodoMigration()
|
|
||||||
];
|
];
|
||||||
|
|
||||||
main(args) => grind(args);
|
main(args) => grind(args);
|
||||||
|
|
Loading…
Reference in a new issue