v0.3.0
What's Changed
@uuid() decorator — new preferred way to declare UUID primary keys
Replace the HasUuids(Model) mixin with the @uuid() property decorator:
// before
class User extends HasUuids(Model) {
declare id: string;
}
// after
class User extends Model {
@uuid()
declare id: string;
}- Sets
incrementing: falseandkeyType: 'string'automatically - Apply to multiple fields to generate UUIDs for extra columns
HasUuidsandHasUlidsare still available for advanced use (custom generator vianewUniqueId())
@table() now accepts a plain string
// before
@table({ name: 'users', primaryKey: 'id', incrementing: false, keyType: 'string' })
// after
@table('users')Pass an object only when you need extra options (primaryKey, timestamps, connection, etc.).
@fillable removed
TypeScript's type system enforces mass-assignment at compile time — a runtime allowlist adds no safety in a typed codebase. Remove @fillable and @guarded from your models. Use @hidden to exclude sensitive fields from JSON serialization.
@map() formatting
The @map('column_name') decorator now sits on its own line above declare:
@map('created_at')
declare createdAt: Date;Breaking changes
@fillableand@guardedare no longer exported. Remove them from your models and imports.HasUuids(Model)pattern is superseded by@uuid().HasUuidsremains exported for backwards compatibility but is no longer documented.