Formatting fixed
This commit is contained in:
@@ -376,19 +376,19 @@ column_sql_for_create_table({Name, Type, Constraints}) ->
|
|||||||
[atom_to_list(Name), " ", col_type_to_string(Type),
|
[atom_to_list(Name), " ", col_type_to_string(Type),
|
||||||
" " | map_intersperse(fun constraint_sql/1, Constraints, " ")].
|
" " | map_intersperse(fun constraint_sql/1, Constraints, " ")].
|
||||||
|
|
||||||
-spec pk_constraint_sql(any ()) -> iolist().
|
-spec pk_constraint_sql(any()) -> iolist().
|
||||||
pk_constraint_sql (Constraint) ->
|
pk_constraint_sql(Constraint) ->
|
||||||
case Constraint of
|
case Constraint of
|
||||||
desc -> "DESK";
|
desc -> "DESK";
|
||||||
autoincrement -> "AUTOINCREMENT";
|
autoincrement -> "AUTOINCREMENT";
|
||||||
L -> lists:map (fun pk_constraint_sql/1, L)
|
L -> lists:map(fun pk_constraint_sql/1, L)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec constraint_sql(any()) -> iolist().
|
-spec constraint_sql(any()) -> iolist().
|
||||||
constraint_sql(Constraint) ->
|
constraint_sql(Constraint) ->
|
||||||
case Constraint of
|
case Constraint of
|
||||||
primary_key -> "PRIMARY KEY";
|
primary_key -> "PRIMARY KEY";
|
||||||
{primary_key, C} -> ["PRIMARY KEY ", pk_constraint_sql (C)];
|
{primary_key, C} -> ["PRIMARY KEY ", pk_constraint_sql(C)];
|
||||||
unique -> "UNIQUE";
|
unique -> "UNIQUE";
|
||||||
not_null -> "NOT NULL";
|
not_null -> "NOT NULL";
|
||||||
{default, DefaultValue} -> ["DEFAULT ", value_to_sql(DefaultValue)]
|
{default, DefaultValue} -> ["DEFAULT ", value_to_sql(DefaultValue)]
|
||||||
|
|||||||
Reference in New Issue
Block a user