From e5036e734f0d401eef1e584c9b90ed8a87710a84 Mon Sep 17 00:00:00 2001 From: thomashii Date: Tue, 18 May 2021 22:47:56 +0800 Subject: [PATCH] Updated migration_runner --- .../angel_migration_runner/example/main.dart | 22 +++++----- .../angel_migration_runner/example/todo.dart | 40 +++++++++++++++++++ packages/pub_sub/CHANGELOG.md | 3 ++ packages/pub_sub/README.md | 2 +- packages/pub_sub/lib/src/isolate/client.dart | 2 +- packages/pub_sub/pubspec.yaml | 2 +- 6 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 packages/orm/angel_migration_runner/example/todo.dart diff --git a/packages/orm/angel_migration_runner/example/main.dart b/packages/orm/angel_migration_runner/example/main.dart index 4189dfe3..0c2f3ac4 100755 --- a/packages/orm/angel_migration_runner/example/main.dart +++ b/packages/orm/angel_migration_runner/example/main.dart @@ -1,21 +1,21 @@ -import 'package:angel_migration/angel_migration.dart'; -import 'package:angel_migration_runner/angel_migration_runner.dart'; -import 'package:angel_migration_runner/postgres.dart'; -import 'package:angel_orm/angel_orm.dart'; +import 'package:angel3_migration/angel3_migration.dart'; +import 'package:angel3_migration_runner/angel3_migration_runner.dart'; +import 'package:angel3_migration_runner/postgres.dart'; +import 'package:angel3_orm/angel3_orm.dart'; import 'package:postgres/postgres.dart'; -import '../../angel_migration/example/todo.dart'; +import 'todo.dart'; -var migrationRunner = new PostgresMigrationRunner( - new PostgreSQLConnection('127.0.0.1', 5432, 'test', +var migrationRunner = PostgresMigrationRunner( + PostgreSQLConnection('127.0.0.1', 5432, 'test', username: 'postgres', password: 'postgres'), migrations: [ - new UserMigration(), - new TodoMigration(), - new FooMigration(), + UserMigration(), + TodoMigration(), + FooMigration(), ], ); -main(List args) => runMigrations(migrationRunner, args); +void main(List args) => runMigrations(migrationRunner, args); class FooMigration extends Migration { @override diff --git a/packages/orm/angel_migration_runner/example/todo.dart b/packages/orm/angel_migration_runner/example/todo.dart new file mode 100644 index 00000000..bf097dfb --- /dev/null +++ b/packages/orm/angel_migration_runner/example/todo.dart @@ -0,0 +1,40 @@ +/// These are straightforward migrations. +/// +/// You will likely never have to actually write these yourself. +import 'package:angel3_migration/angel3_migration.dart'; + +class UserMigration implements Migration { + @override + void up(Schema schema) { + schema.create('users', (table) { + table + ..serial('id').primaryKey() + ..varChar('username', length: 32).unique() + ..varChar('password') + ..boolean('account_confirmed').defaultsTo(false); + }); + } + + @override + void down(Schema schema) { + schema.drop('users'); + } +} + +class TodoMigration implements Migration { + @override + void up(Schema schema) { + schema.create('todos', (table) { + table + ..serial('id').primaryKey() + ..integer('user_id').references('users', 'id').onDeleteCascade() + ..varChar('text') + ..boolean('completed').defaultsTo(false); + }); + } + + @override + void down(Schema schema) { + schema.drop('todos'); + } +} diff --git a/packages/pub_sub/CHANGELOG.md b/packages/pub_sub/CHANGELOG.md index 74d0123b..9b3491e5 100644 --- a/packages/pub_sub/CHANGELOG.md +++ b/packages/pub_sub/CHANGELOG.md @@ -1,3 +1,6 @@ +# 3.0.2 +* Resolved static analysis warnings + # 3.0.1 * Resolved static analysis warnings # 3.0.0 diff --git a/packages/pub_sub/README.md b/packages/pub_sub/README.md index b4b18d9f..d2d84569 100644 --- a/packages/pub_sub/README.md +++ b/packages/pub_sub/README.md @@ -1,5 +1,5 @@ # angel3_pub_sub -[![version](https://img.shields.io/badge/pub-v3.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_pub_sub) +[![version](https://img.shields.io/badge/pub-v3.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_pub_sub) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) diff --git a/packages/pub_sub/lib/src/isolate/client.dart b/packages/pub_sub/lib/src/isolate/client.dart index 3e3b8131..7c80cdd5 100644 --- a/packages/pub_sub/lib/src/isolate/client.dart +++ b/packages/pub_sub/lib/src/isolate/client.dart @@ -159,7 +159,7 @@ class _IsolateClientSubscription extends ClientSubscription { } @override - StreamSubscription listen(void onData(event)?, + StreamSubscription listen(void Function(dynamic event)? onData, {Function? onError, void Function()? onDone, bool? cancelOnError}) { return _stream.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); diff --git a/packages/pub_sub/pubspec.yaml b/packages/pub_sub/pubspec.yaml index 664f1b18..9e6eff82 100644 --- a/packages/pub_sub/pubspec.yaml +++ b/packages/pub_sub/pubspec.yaml @@ -1,5 +1,5 @@ name: angel3_pub_sub -version: 3.0.1 +version: 3.0.2 description: Keep application instances in sync with a simple pub/sub API. homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/pub_sub environment: