Please open a ticket at http://github.com/dpp/liftweb/issues
On Fri, Oct 2, 2009 at 2:57 AM, Ewan <[email protected]> wrote: > > All > > Using Derby and have hit an issue when running some SQL scripts to > insert data into a fresh mapper DB created by schemifier. > Specifically when inserting records with the id column I get a > violation: > > Error: Attempt to modify an identity column 'ID'. > SQLState: 42Z23 > ErrorCode: -1 > > i.e data can't be inserted into this column which is not helpful when > this id is the primary key and foreign key on another table. Derby > does support auto-incremented sequence values as *default only* when > you are not providing values as opposed to always providing auto- > incremented sequence values which you are not allowed to specify your > own values. The difference is GENERATED BY DEFAULT AS IDENTITY > instead of GENERATED ALWAYS AS IDENTITY. > > To this end it looks like net.liftweb.mapper.DerbyDriver.scala needs > updating from > def integerIndexColumnType = "INTEGER NOT NULL GENERATED ALWAYS AS > IDENTITY" > def longIndexColumnType = "BIGINT NOT NULL GENERATED ALWAYS AS > IDENTITY" > > to > def integerIndexColumnType = "INTEGER NOT NULL GENERATED BY DEFAULT > AS IDENITY" > def longIndexColumnType = "BIGINT NOT NULL GENERATED BY DEFAULT AS > IDENTITY" > > Hope this helps > > -- Ewan > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
