Updated angel_migration_runner

This commit is contained in:
thomashii 2021-07-19 12:49:31 +08:00
parent 7d815a2aa0
commit 28c4705898
6 changed files with 60 additions and 25 deletions

View file

@ -6,7 +6,7 @@
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_migration/LICENSE)
A database migration framework built for Angel3 ORM
A database migration framework built for Angel3 ORM.
Supported database:

View file

@ -1,41 +1,61 @@
# 4.0.0-beta.2
# Change Log
## 4.0.0-beta.3
* Updated README
## 4.0.0-beta.2
* Resolved static analysis warnings
# 4.0.0-beta.1
## 4.0.0-beta.1
* Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0
## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.0.0
## 2.0.0
* Bump to `2.0.0`.
# 2.0.0-beta.1
## 2.0.0-beta.1
* Make `reset` reverse migrations.
# 2.0.0-beta.0
## 2.0.0-beta.0
* Make `reset` reverse migrations.
# 2.0.0-alpha.5
## 2.0.0-alpha.5
* Support default values for columns.
# 2.0.0-alpha.4
## 2.0.0-alpha.4
* Include the names of migration classes when running.
# 2.0.0-alpha.3
## 2.0.0-alpha.3
* Run migrations in reverse on `rollback`.
# 2.0.0-alpha.2
## 2.0.0-alpha.2
* Run migrations in reverse on `reset`.
# 2.0.0-alpha.1
## 2.0.0-alpha.1
* Cast Iterables via `.cast()`, rather than `as`.
# 2.0.0-alpha
## 2.0.0-alpha
* Dart 2 update.
# 1.0.0-alpha+5
`Schema#drop` now has a named `cascade` parameter, of type `bool`.
## 1.0.0-alpha+5
# 1.0.0-alpha+1
* You can now pass a `connected` parameter.
`Schema##drop` now has a named `cascade` parameter, of type `bool`.
## 1.0.0-alpha+1
* You can now pass a `connected` parameter.

View file

@ -1,8 +1,13 @@
# angel3_migration_runner
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_migration_runner)
# Angel3 Migration Runner
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_migration_runner)
[![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)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_migration_runner/LICENSE)
A PostgreSQL database migration framework built on Angel's ORM.
Command-line based database migration runner for Angel3 ORM.
Supported database:
* postgresql version 9, 10, 11 and 12

View file

@ -5,7 +5,7 @@ import 'package:charcode/ascii.dart';
abstract class PostgresGenerator {
static String columnType(MigrationColumn column) {
var str = column.type!.name;
var str = column.type.name;
if (column.length != null) {
return '$str(${column.length})';
} else {

View file

@ -4,10 +4,18 @@ import 'dart:mirrors';
Future<String> absoluteSourcePath(Type type) async {
var mirror = reflectType(type);
if (mirror.location == null) {
throw ArgumentError('Invalid location');
}
var uri = mirror.location!.sourceUri;
if (uri.scheme == 'package') {
uri = await (Isolate.resolvePackageUri(uri) as FutureOr<Uri>);
var packageUrl = await Isolate.resolvePackageUri(uri);
if (packageUrl != null) {
uri = packageUrl;
}
}
return uri.toFilePath() + '#' + MirrorSystem.getName(mirror.simpleName);

View file

@ -1,7 +1,8 @@
name: angel3_migration_runner
version: 4.0.0-beta.2
description: Command-line based database migration runner for Angel's ORM.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_migration_runner
version: 4.0.0-beta.3
description: Command-line based database migration runner for Angel3's ORM.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_migration_runner
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
@ -10,4 +11,5 @@ dependencies:
args: ^2.1.0
charcode: ^1.2.0
postgres: ^2.3.2
dev_dependencies:
pedantic: ^1.11.0