issue model created within the database

This commit is contained in:
Jacob Delgado 2023-10-20 23:45:30 -07:00
parent 3239d73045
commit 4fa957c1a0
6 changed files with 33 additions and 1 deletions

View File

@ -5,4 +5,4 @@
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
# DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
DATABASE_URL="mysql://'alpha':'!Plop2099'@192.168.50.190:3306/db"
DATABASE_URL="mysql://root:%21Plop2099341723@192.168.50.190:3306/db"

Binary file not shown.

View File

@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@prisma/client": "5.4.2",
"classnames": "^2.3.2",
"next": "13.5.6",
"prisma": "^5.4.2",

View File

@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE `Issue` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NOT NULL,
`status` ENUM('OPEN', 'IN_PROGRESS', 'CLOSED') NOT NULL DEFAULT 'OPEN',
`createdAT` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "mysql"

View File

@ -10,3 +10,20 @@ datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Issue {
id Int @id @default(autoincrement()) // auto increasing id number for issues
title String @db.VarChar(255) // change varchar(variable character limit to 255)
description String @db.Text // issue description
status Status @default(OPEN) // stating issue is open
createdAT DateTime @default(now()) // creation time
updatedAt DateTime @updatedAt // updated time
}
// issue status, or ticket status
// supported in mysql, but possibly not other db's
enum Status {
OPEN
IN_PROGRESS
CLOSED
}