Using Postgresql with Grails : Missing sequence or table: hibernate_sequence

前端 未结 2 1064
[愿得一人]
[愿得一人] 2021-02-11 06:44

I\'m having trouble with Grails 2.0 and Postgresql 9.1

I\'m trying to map an existing database, with sequential ids. However, even without creating any class in the doma

相关标签:
2条回答
  • 2021-02-11 07:00

    You can configure Postgres to use one sequence per table - I described that here: http://grails.1312388.n4.nabble.com/One-hibernate-sequence-is-used-for-all-Postgres-tables-td1351722.html

    But you'll still need to create the sequence(s). dbCreate='update' doesn't create sequences (only create and create-drop do) so you'll need to manually create them or use a migration tool like http://www.grails.org/plugin/database-migration

    0 讨论(0)
  • 2021-02-11 07:04

    You probably have one of the entities using a sequence ID generator without any sequence name configured, and Hibernate thus uses the default sequence name: hibernate_sequence, but doesn't find it.

    Configure the sequence name (and use an existing sequence), or create the hibernate_sequence sequence in database, or don't use a sequence-based generator.

    0 讨论(0)
提交回复
热议问题