Skip to content

Commit

Permalink
bugfix: also add generated columns for SQLite
Browse files Browse the repository at this point in the history
SQLite's generated column syntax is identical to that of Postgres'
  • Loading branch information
bokwoon95 committed Feb 24, 2024
1 parent b745be4 commit 9d23026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ddl/dump_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ func writeColumnDefinition(dialect string, buf *bytes.Buffer, defaultCollation s
if column.GeneratedExpr != "" {
generatedExpr := wrapBrackets(column.GeneratedExpr)
switch dialect {
case DialectPostgres:
case DialectSQLite, DialectPostgres:
buf.WriteString(" GENERATED ALWAYS AS " + generatedExpr + " STORED")
case DialectMySQL:
buf.WriteString(" AS " + generatedExpr)
Expand Down

0 comments on commit 9d23026

Please sign in to comment.