Create a new reviews table. The reviews table will store product reviews and therefore should have a belongs to association with the products table.
This table should have two columns, text and rating where rating is an integer.
Create this new table via a migration. 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 reviews table and is associated with the products table.
There should also be a new migration that applies this change to the database.
Description:
Create a new
reviews
table. Thereviews
table will store product reviews and therefore should have abelongs to
association with theproducts
table.This table should have two columns,
text
andrating
where rating is an integer.Create this new table via a migration. 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
reviews
table and is associated with the products table.There should also be a new migration that applies this change to the database.