You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently migrating deployed schema's is very cumbersome to maintain. You could
attempt to migrate schema's like:
(defschema old-schema
old: string)
(defschema new-schema
new: string)
(defun get-row(id: string)
(try
(with-read table id
{ "new":= new }
{ "new": new })
(with-read table id
{ "old":= old }
(update table id { "new": old })
{ "new": old })))
Note, not sure if this code works.
This would maybe work for moving schema attributes, but what about adding a new column?
Or changing the type of an existing column?
To assist in such migration I'd like to propose the following schema annotations:
(defschema new-schema
@moved(new)
old: string
new: string
@convert(str-to-int)
@convert(custom-func-to-convert)
type-changed: integer ; assuming the old schema was a string
@default("default value if not present")
new-column: string)
The text was updated successfully, but these errors were encountered:
Currently migrating deployed schema's is very cumbersome to maintain. You could
attempt to migrate schema's like:
Note, not sure if this code works.
This would maybe work for moving schema attributes, but what about adding a new column?
Or changing the type of an existing column?
To assist in such migration I'd like to propose the following schema annotations:
The text was updated successfully, but these errors were encountered: