diff --git a/angel_migration/lib/src/column.dart b/angel_migration/lib/src/column.dart index 882efe24..e06438b7 100755 --- a/angel_migration/lib/src/column.dart +++ b/angel_migration/lib/src/column.dart @@ -12,7 +12,6 @@ class MigrationColumn extends Column { @override IndexType get indexType => _index; - @override get defaultValue => _defaultValue; List get externalReferences => diff --git a/angel_orm/CHANGELOG.md b/angel_orm/CHANGELOG.md index d08b3d35..47ca4bf1 100644 --- a/angel_orm/CHANGELOG.md +++ b/angel_orm/CHANGELOG.md @@ -1,6 +1,7 @@ # 2.0.0-dev.24 * Fix a bug that caused syntax errors on `ORDER BY`. * Add `pattern` to `like` on string builder. `sanitize` is optional. +* Add `RawSql`. # 2.0.0-dev.23 * Add `@ManyToMany` annotation, which builds many-to-many relations. diff --git a/angel_orm/lib/src/annotations.dart b/angel_orm/lib/src/annotations.dart index 3231bf23..567650fa 100644 --- a/angel_orm/lib/src/annotations.dart +++ b/angel_orm/lib/src/annotations.dart @@ -1,3 +1,16 @@ +/// A raw SQL statement that specifies a date/time default to the +/// current time. +const RawSql currentTimestamp = const RawSql('CURRENT_TIMESTAMP'); + +/// Can passed to a [MigrationColumn] to default to a raw SQL expression. +class RawSql { + /// The raw SQL text. + final String value; + + const RawSql(this.value); +} + +/// Canonical instance of [ORM]. Implies all defaults. const Orm orm = const Orm(); class Orm {