How can I represent the following check constraint in Slick mapping definitions?
CREATE TABLE mySchema.myTable
(
id character varying(255) NOT NULL,
name text NOT NULL,
active boolean NOT NULL,
CONSTRAINT pkey PRIMARY KEY (id, name),
CONSTRAINT check_valid_name check (name in ('Name1', 'Name2'))
);
How can I use the check_valid_name in my Slick table definitions in Scala?
I don't think there exist any way of doing thing through table definitions. If you want to achieve this through slick you can use staticquery to define your constraint.