Fixed a bug with multiple primary key subconstraints
This commit is contained in:
@@ -382,7 +382,7 @@ pk_constraint_sql(Constraint) ->
|
|||||||
desc -> "DESC";
|
desc -> "DESC";
|
||||||
asc -> "ASC";
|
asc -> "ASC";
|
||||||
autoincrement -> "AUTOINCREMENT";
|
autoincrement -> "AUTOINCREMENT";
|
||||||
L -> lists:map(fun pk_constraint_sql/1, L)
|
List -> map_intersperse(fun pk_constraint_sql/1, List, " ")
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec constraint_sql(any()) -> iolist().
|
-spec constraint_sql(any()) -> iolist().
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ basic_functionality() ->
|
|||||||
Columns = ["id", "name", "age", "wage"],
|
Columns = ["id", "name", "age", "wage"],
|
||||||
AllRows = [{1, <<"abby">>, 20, 2000}, {2, <<"marge">>, 30, 2000}],
|
AllRows = [{1, <<"abby">>, 20, 2000}, {2, <<"marge">>, 30, 2000}],
|
||||||
AbbyOnly = [{1, <<"abby">>, 20, 2000}],
|
AbbyOnly = [{1, <<"abby">>, 20, 2000}],
|
||||||
TableInfo = [{id, integer, [{primary_key, [autoincrement]}]}, {name, text, [not_null, unique]}, {age, integer}, {wage, integer}],
|
TableInfo = [{id, integer, [{primary_key, [asc, autoincrement]}]}, {name, text, [not_null, unique]}, {age, integer}, {wage, integer}],
|
||||||
drop_all_tables(ct),
|
drop_all_tables(ct),
|
||||||
?WARN_ERROR_MESSAGE,
|
?WARN_ERROR_MESSAGE,
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
|
|||||||
Reference in New Issue
Block a user