Closed jaymes15 closed 1 year ago
I am curious. This should never happen. script_migration
is an auto-managed table by this library, you should never modify the data or data structure.
If this is not reason of the problem, can you show the content of the 20230717_225627_script_migration.surql
file?
@Odonno here is the content of script_migration.surql
DEFINE TABLE script_migration SCHEMAFULL;
DEFINE FIELD script_name ON script_migration TYPE string;
DEFINE FIELD executed_at ON script_migration TYPE datetime VALUE $before OR time::now();
After checking internally, this was due to the OPTION IMPORT
statement in a schema file. This statement erases the database entirely before import.
@Odonno While trying to apply migrations using
surrealdb-migrations apply
I get the following error:Here is a screenshot for my migration folder:
I noticed from the error that
script_migration
asexecuted_at
field in20230717_225627_script_migration.surql
but20230717_225815_001_Index.surql
does not haveexecuted_at
field, hence the error.