Bug 365 : ADD CONSTRAINT SQLite Incompatibility
Priority 
High
Reported Version 
 
Logged By 
DThielke
Status 
Fixed
Fixed Version 
github
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
10/04/2011
Updated 
10/04/2011
Type 
Bug
 
Attachments 
No attachments

I'm not sure where else this occurs, but when using the @OneToMany and @ManyToOne annotations on a Set, ebeans fails when using SQLite. Ebeans creates the necessary tables then tries to run a statement including 'ADD CONSTRAINT'. However, this feature is not supported by SQLite as indicated here: http://www.sqlite.org/omitted.html. This incompatibility causes ebeans to error out.

In my specific case, the full SQL statement was: alter table privileged_player add constraint fk_privileged_player_list_1 foreign key (list_id) references privileged_list (id)

Would it be possible to include a workaround specifically for SQLite to prevent this bug? The ALTER TABLE statement seems unnecessary as it's being altered immediately after creation.

A fix for this would be very much appreciated.

 
woResponse

Upload a file