Skip to content

Commit 1778aa8

Browse files
committed
🐛 (parser) only check when type is table
follow-up to missing #103
1 parent 25748dd commit 1778aa8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/sql/parser.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ M.table_alter_key_defs = function(tname, new, old, dry)
473473
local with_foregin_key = false
474474

475475
for _, def in pairs(new) do
476-
if def.reference then
476+
if type(def) == "table" and def.reference then
477477
with_foregin_key = true
478478
end
479479
end
@@ -507,7 +507,7 @@ M.table_alter_key_defs = function(tname, new, old, dry)
507507
local update_null_vals = {}
508508
local update_null_stmt = "UPDATE %s SET %s=%s where %s IS NULL"
509509
for key, def in pairs(new) do
510-
if def.default and not def.required then
510+
if type(def) == "table" and def.default and not def.required then
511511
tinsert(update_null_vals, update_null_stmt:format(tmpname, key, def.default, key))
512512
end
513513
end

0 commit comments

Comments
 (0)