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
I am using following domain class mapping to enable direct SQL inserts.
classFoo {
static mapping = {
id defaultValue:"nextval('seq_foo')"
}
}
When using dbCreate = 'update' in datasource table and sequence are automatically created when running 'grails run-app'.
The problem is that table is created first and causes error:
[main] ERROR o.h.tool.hbm2ddl.SchemaUpdate - ERROR: relation "seq_foo" does not exist
The workaround is to rerun "grails run-app".
Sequence should be created before table to fix that issue.
The text was updated successfully, but these errors were encountered:
Maybe I'm missing something but why are you doing this? When you say to enable direct SQL inserts you mean to be able to do an insert without setting a value for the id column?
I am using following domain class mapping to enable direct SQL inserts.
When using dbCreate = 'update' in datasource table and sequence are automatically created when running 'grails run-app'.
The problem is that table is created first and causes error:
The workaround is to rerun "grails run-app".
Sequence should be created before table to fix that issue.
The text was updated successfully, but these errors were encountered: