So I was trying to implement an index from my database to my slick tables. I'm using postgres as my database and this is how my index looks:
"index_unq_user_status" UNIQUE, btree (user_id) WHERE status::text = 'Pending'::text
Basically, it can't be two rows with the same user_id if they have both a 'Pending' status.
What's my problem? When I generate my tables with Slick I get this:
val index1 = index("index_unq_user_status", userId, unique=true)
It means, just can be one row with one userId.
I want to make an integration test using an h2 database and it uses the tables from slick and it creates the wrong index.
Is there any way to achieve that conditional index in slick?