Add a new boolean column named deleted on the products table.
This column will be used to build a "Soft Delete" mechanism for products.
We need this soft delete mechanism because if we attempted to delete a product
being referenced in other table entries, it would require us to delete those
associated entries. Otherwise, it would cause a foreign key violation.
Create and run a migration that adds the deleted column to products. It should have a default value of false.
You can create a new migration by running npx prisma migrate dev --name {your-migration-name-here}. See this guide.
Acceptance Criteria:
The prisma schema should now include a deleted column on the products table with a default value of false.
There should also be a new migration that applies this column to the database.
Description:
Add a new boolean column named
deleted
on the products table.This column will be used to build a "Soft Delete" mechanism for products.
We need this soft delete mechanism because if we attempted to delete a product being referenced in other table entries, it would require us to delete those associated entries. Otherwise, it would cause a foreign key violation.
Create and run a migration that adds the
deleted
column to products. It should have a default value offalse
.You can create a new migration by running
npx prisma migrate dev --name {your-migration-name-here}
. See this guide.Acceptance Criteria:
The prisma schema should now include a
deleted
column on the products table with a default value offalse
.There should also be a new migration that applies this column to the database.