How to replace enum type in H2 database?
I'm not sure if this is what you are looking for, but would you could do is use a check constraint:
CREATE TABLE My_Table(my_column varchar(255)
check (my_column in ('first', 'second', 'last')));
-- fails:
insert into My_Table values('x');
-- ok:
insert into My_Table values('first');
This will work in H2, Apache Derby, PostgreSQL, HSQLDB, and even SQLite. I didn't test other databases.
There is none; still, enum
is not a great solution in any case, just use a a reference table.