Check for empty string in postgres
Hi. First post. π Started looking into migrating our project to drizzle today and am loving it so far.
I want to add a not-empty check and from what I gathered from the docs and this example https://github.com/drizzle-team/drizzle-orm/blob/b003e523c637c81e2c522003db03d3d9bd98b723/drizzle-orm/type-tests/pg/tables.ts#L76 (which is the only one I could find) this code should work:
But it doesn't :/ the index works, but the check does not. There is no SQL generated for the migration but to be sure I also tested it in runtime after migrating but no luck. Any advice?
5 Replies
@Andrii Sherman
@bloberenober
this seems like a migration generation bug?
@Martnart the case is that checks are not supported in drizzle-kit yet
But itβs in our backlog. You can check #drizzle-plans for that
Current workaround to add check statement manually to sql file before applying to database
Thanks for prompt reply. I was a bit confused because it is already being used in the test file linked above.
Anyway, great job that you guys are doing. Looking forward to a bright future with drizzle π