From 7c27a329e56b7f9b7f8a9f1cf7808dc157380664 Mon Sep 17 00:00:00 2001 From: thosakwe Date: Mon, 7 Aug 2017 22:08:52 -0400 Subject: [PATCH] fix migration --- lib/src/commands/make/model.dart | 18 +++++++++--------- lib/src/commands/pubspec.update.g.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/src/commands/make/model.dart b/lib/src/commands/make/model.dart index 3d4af78..9b54442 100644 --- a/lib/src/commands/make/model.dart +++ b/lib/src/commands/make/model.dart @@ -101,8 +101,7 @@ class ModelCommand extends Command { ..reset(); if (argResults['migration']) { - deps.add( - const MakerDependency('angel_migration', '^1.0.0-alpha')); + deps.add(const MakerDependency('angel_migration', '^1.0.0-alpha')); var migrationLib = new LibraryBuilder() ..addDirective( @@ -129,7 +128,8 @@ class ModelCommand extends Command { ]); callback.addStatement(cascade); - up.addStatement(reference('schema').invoke('create', [callback])); + up.addStatement( + reference('schema').invoke('create', [literal(tableName), callback])); // down() var down = new MethodBuilder('down', returnType: lib$core.$void); @@ -148,12 +148,12 @@ class ModelCommand extends Command { await migrationFile.create(recursive: true); await migrationFile .writeAsString(prettyToSource(migrationLib.buildAst())); - _pen - ..green() - ..call( - '${Icon.CHECKMARK} Created migration file "${migrationFile.absolute.path}".') - ..call() - ..reset(); + _pen + ..green() + ..call( + '${Icon.CHECKMARK} Created migration file "${migrationFile.absolute.path}".') + ..call() + ..reset(); } if (deps.isNotEmpty) await depend(deps); diff --git a/lib/src/commands/pubspec.update.g.dart b/lib/src/commands/pubspec.update.g.dart index 3ef3765..7cf40e1 100644 --- a/lib/src/commands/pubspec.update.g.dart +++ b/lib/src/commands/pubspec.update.g.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:http/src/base_client.dart' as http; import 'package:pub_semver/pub_semver.dart'; -final Version PACKAGE_VERSION = new Version(1, 1, 5, build: '1'); +final Version PACKAGE_VERSION = new Version(1, 1, 5, build: '2'); Future fetchCurrentVersion(http.BaseClient client) async { var response = await client.get('https://pub.dartlang.org/api/packages/angel_cli'); diff --git a/pubspec.yaml b/pubspec.yaml index 15eab6e..8c31aa7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: "Tobe O " description: "Command-line tools for the Angel framework." homepage: "https://github.com/angel-dart/angel_cli" name: "angel_cli" -version: 1.1.5+1 +version: 1.1.5+2 dependencies: # analyzer: "^0.29.0" args: ^0.13.4