dialect/sql/schema: allow setting JSON default values on pg, sqlite and maria (#3081)

This commit is contained in:
Ariel Mashraki
2022-11-11 07:41:21 +02:00
committed by GitHub
parent b86bc12db9
commit 3b5a535801
14 changed files with 258 additions and 13 deletions

View File

@@ -400,6 +400,11 @@ func (d *SQLite) atTable(t1 *Table, t2 *schema.Table) {
}
}
func (d *SQLite) supportsDefault(*Column) bool {
// SQLite supports default values for all standard types.
return true
}
func (d *SQLite) atTypeC(c1 *Column, c2 *schema.Column) error {
if c1.SchemaType != nil && c1.SchemaType[dialect.SQLite] != "" {
t, err := sqlite.ParseType(strings.ToLower(c1.SchemaType[dialect.SQLite]))