Add abilty to mark that column can be null in e_sql_schema

This commit is contained in:
Pawel Chmielowski
2026-02-27 09:46:18 +01:00
parent 1695385912
commit ca56f11dc6
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -51,6 +51,7 @@
meta = #{}}).
-record(sql_column, {name :: binary(),
type,
nullable = false,
default = false,
opts = []}).
-record(sql_table, {name :: binary(),
+4 -1
View File
@@ -526,7 +526,10 @@ format_column_def(SchemaInfo, Column) ->
[<<" ">>,
escape_name(SchemaInfo, Column#sql_column.name), <<" ">>,
format_type(SchemaInfo, Column),
<<" NOT NULL">>,
case Column#sql_column.nullable of
false -> <<" NOT NULL">>;
true -> []
end,
case Column#sql_column.default of
false -> [];
true ->