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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---