migration.sql 945 B

1234567891011121314151617
  1. -- Corrects the nullability of the scalar list columns added by
  2. -- 20260815120000_inspection_eu_compliance and
  3. -- 20260815140000_inspection_defect_suggestions.
  4. --
  5. -- Those migrations declared the arrays NOT NULL. Prisma maps a `String[]` field
  6. -- to a plain nullable array column and enforces the "never null" part in the
  7. -- client, so the NOT NULL left the database a step ahead of the schema and
  8. -- every `prisma migrate dev` wanted to write a migration removing it.
  9. --
  10. -- Fixed forward rather than by editing those files: both have already been
  11. -- applied, and Prisma checksums applied migrations. Idempotent; safe to re-run.
  12. ALTER TABLE "inspection_template_items" ALTER COLUMN "choices" DROP NOT NULL;
  13. ALTER TABLE "inspection_template_items" ALTER COLUMN "defectSuggestions" DROP NOT NULL;
  14. ALTER TABLE "inspection_items" ALTER COLUMN "choices" DROP NOT NULL;
  15. ALTER TABLE "inspection_items" ALTER COLUMN "defectSuggestions" DROP NOT NULL;