mirror of
https://github.com/Floriansylvain/PopCorn.git
synced 2026-08-19 11:43:23 +02:00
Finition de la base de donnée
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `url` to the `Jeux` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `Jeux` ADD COLUMN `url` VARCHAR(191) NOT NULL;
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `url` on the `Jeux` table. All the data in the column will be lost.
|
||||
- Added the required column `lien` to the `Jeux` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `Jeux` DROP COLUMN `url`,
|
||||
ADD COLUMN `lien` VARCHAR(191) NOT NULL;
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `Workers` on the `Jeux` table. All the data in the column will be lost.
|
||||
- Added the required column `groupe_id` to the `Jeux` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `Jeux` DROP COLUMN `Workers`,
|
||||
ADD COLUMN `groupe_id` INTEGER NOT NULL;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `Groupe` (
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(191) NOT NULL,
|
||||
`logo` VARCHAR(255) NOT NULL,
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Jeux` ADD CONSTRAINT `Jeux_groupe_id_fkey` FOREIGN KEY (`groupe_id`) REFERENCES `Groupe`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
+10
-1
@@ -10,10 +10,19 @@ datasource db {
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model Groupe{
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
logo String @db.VarChar(255)
|
||||
jeux Jeux []
|
||||
}
|
||||
model Jeux{
|
||||
id Int @id @default(autoincrement())
|
||||
Title String
|
||||
Description String
|
||||
Picture String @db.VarChar(255)
|
||||
Workers String
|
||||
lien String
|
||||
groupe_id Int
|
||||
groupe Groupe @relation(fields: [groupe_id], references: [id])
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user