Skip to content

Commit

Permalink
fix onTable (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsumura-h authored Jan 28, 2025
1 parent 6e5dd41 commit 38c6b61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/allographer/schema_builder/models/column.nim
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,19 @@ proc reference*(self:Column, column:string):Column =


proc onTable*(self:Column, table:string):Column =
self.info["table"] = %*table
if self.info.kind == JNull:
self.info = %*{"table": table}
else:
self.info["table"] = %table
return self


when NimMajor == 1:
proc on*(self:Column, table:string):Column {.deprecated: "Consider using onTable instead".} =
self.info["table"] = %*table
return self


proc onDelete*(self:Column, kind:ForeignOnDelete):Column =
self.foreignOnDelete = kind
return self
Expand Down

0 comments on commit 38c6b61

Please sign in to comment.