diff --git a/CHANGELOG.md b/CHANGELOG.md index e721e39..ef74ba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 0.8.0 - Added support for serialization through custom annotations -- Added support for manual migration output to .sql files +- Improved migration cli and added support for manual migration output to .sql files - Fixed bug with default views and value decoding # 0.7.0 diff --git a/README.md b/README.md index 206ccf9..634aed2 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,7 @@ await db.users.updateOne(UserUpdateRequest(id: 'abc', name: 'Tom')); You can specify a custom query with custom sql by extending the `Query` class. You will then need to implement the `Future apply(Database db, U params)` method. -Additionally to the model tabels, you can query the model views to automatically get all resolved +Additionally to the model tables, you can query the model views to automatically get all resolved relations without needing to do manual joins. Table names are always plural, e.g. `users` and view names are in the format as `complete_user_view`. @@ -408,7 +408,7 @@ Stormberry comes with a database migration tool, to create or update the schema To use this run the following command from the root folder of your project. ``` -dart pub run stormberry +dart pub run stormberry migrate ``` In order to connect to your database, provide the following environment variables: @@ -419,7 +419,8 @@ confirmation before applying the changes or aborting. The tool supported the following options: -- `-db=`: Specify the database name. Tool will ask if not specified. +- `-h`: Shows the available options. +- `--db=`: Specify the database name. Tool will ask if not specified. - `--dry-run`: Logs any changes to the schema without writing to the database, and exists with code 1 if there are any. - `--apply-changes`: Apply any changes without asking for confirmation. diff --git a/pubspec.yaml b/pubspec.yaml index 784e58d..6e5198c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: stormberry description: Access your postgres database effortlessly from dart code. -version: 0.7.0 +version: 0.8.0 repository: https://github.com/schultek/stormberry issue_tracker: https://github.com/schultek/stormberry/issues @@ -19,7 +19,7 @@ dependencies: dev_dependencies: build_runner: ^2.2.0 lints: ^2.0.0 - test: ^1.21.6 + test: ^1.21.0 environment: sdk: '>=2.16.0 <3.0.0' diff --git a/test/multi_schema_test.dart b/test/multi_schema_test.dart index e04f4d4..faf011f 100644 --- a/test/multi_schema_test.dart +++ b/test/multi_schema_test.dart @@ -25,7 +25,7 @@ void main() { test('Migrating schemas', () async { var proc = await Process.start( 'dart', - 'run stormberry --apply-changes'.split(' '), + 'run stormberry migrate --apply-changes'.split(' '), workingDirectory: 'test/packages/multi_schema', environment: { 'DB_HOST': 'localhost', diff --git a/test/serialization_test.dart b/test/serialization_test.dart index c8c6efb..55662dd 100644 --- a/test/serialization_test.dart +++ b/test/serialization_test.dart @@ -38,7 +38,7 @@ void main() { expect(lines[0], equals('{"id":"abc","name":"Tom","securityNumber":"12345"}')); expect(lines[1], equals('DefaultUserView(id: abc, name: Alex, securityNumber: 12345)')); expect(lines[2], equals('{"id":"01","member":{"id":"def","name":"Susan"}}')); - expect(lines[3], equals('{"companyId":null,"id":"abc","name":null,"securityNumber":"007"}')); + expect(lines[3], equals('{"id":"abc","name":null,"securityNumber":"007"}')); expect(lines[4], equals('')); }, timeout: Timeout(Duration(seconds: 60)));