enum status table schema
Hey all, using drizzle + pscale + next.
I'm making a CRM which has a status field for all records which are predefined (e.g. "verified", "shipped", "complete", "rejected".etc). I'm having trouble getting my head around how to get my zod schema to match up with these possible statuses. In drizzle and mysql there is an ENUM column type, but I would prefer to keep the possible statuses in a table. Does anyone know a good approach for this? Thanks!
1 Reply
I suppose im looking for a way to treat data on the table as a schema, with the source of truth in a schema file, which would need to be migrated if anything changed. Drizzle for data... Is this silly?
ENUM looks like its the way, cheers