switched prisma env to linux and changed example.env

This commit is contained in:
Polaris
2024-07-14 17:41:59 -04:00
parent 974132f788
commit 9e75dffcc5
32 changed files with 130 additions and 284 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"name": "prisma-client-cc20179de8517816c47ab493638d5197db96e7b7784693a96b26988e2eafd496",
"name": "prisma-client-2d5d87e9ae5d9ebdfab01e7bca8cfcde406f25147b30adc19ba9541f46ca1db5",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",

View File

@ -318,7 +318,7 @@ model chuni_item_login_bonus {
version Int
presetId Int
bonusCount Int @default(0)
lastUpdateDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
lastUpdateDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
isWatched Boolean? @default(false)
isFinished Boolean? @default(false)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, map: "chuni_item_login_bonus_ibfk_1")
@ -402,7 +402,7 @@ model chuni_item_print_state {
id Int @id @default(autoincrement())
user Int
hasCompleted Boolean @default(false)
limitDate DateTime @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
limitDate DateTime @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
placeId Int?
cardId Int?
gachaId Int?
@ -958,10 +958,10 @@ model chuni_static_gachas {
ceilingCnt Int? @default(10)
changeRateCnt1 Int? @default(0)
changeRateCnt2 Int? @default(0)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
@@unique([version, gachaId, gachaName], map: "chuni_static_gachas_uk")
}
@ -1067,7 +1067,7 @@ model cozynet_chuni_static_trophies {
model cozynet_rival_codes {
id Int @id
rival_code Int?
aime_user aime_user @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cozynet_rival_codes_ibfk_1")
aime_user aime_user @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cozynet_rival_codes_ibfk_1")
}
model cxb_playlog {
@ -1087,7 +1087,7 @@ model cxb_playlog {
fail Int?
combo Int?
date_scored DateTime? @default(now()) @db.Timestamp(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_playlog_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_playlog_ibfk_1")
@@index([user], map: "user")
}
@ -1099,7 +1099,7 @@ model cxb_profile {
version Int
index Int
data String @db.LongText
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_profile_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_profile_ibfk_1")
@@unique([user, index], map: "cxb_profile_uk")
}
@ -1111,7 +1111,7 @@ model cxb_ranking {
song_id Int?
score Int?
clear Int?
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_ranking_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_ranking_ibfk_1")
@@unique([user, rev_id], map: "cxb_ranking_uk")
}
@ -1120,7 +1120,7 @@ model cxb_rev_energy {
id Int @id @default(autoincrement())
user Int @unique(map: "cxb_rev_energy_uk")
energy Int @default(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_rev_energy_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_rev_energy_ibfk_1")
}
/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
@ -1131,7 +1131,7 @@ model cxb_score {
song_mcode String? @db.VarChar(7)
song_index Int?
data String? @db.LongText
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_score_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_score_ibfk_1")
@@unique([user, song_mcode, song_index], map: "cxb_score_uk")
}
@ -1168,7 +1168,7 @@ model diva_playlog {
worst Int?
max_combo Int?
date_scored DateTime? @default(now()) @db.Timestamp(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "diva_playlog_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "diva_playlog_ibfk_1")
@@index([user], map: "user")
}
@ -1288,7 +1288,7 @@ model diva_score {
sad Int?
worst Int?
max_combo Int?
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "diva_score_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "diva_score_ibfk_1")
@@unique([user, pv_id, difficulty, edition], map: "diva_score_uk")
}
@ -2372,10 +2372,10 @@ model mai2_static_cards {
version Int
cardId Int
cardName String @db.VarChar(255)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
enabled Boolean? @default(true)
@@unique([version, cardId, cardName], map: "mai2_static_cards_uk")
@ -3085,11 +3085,11 @@ model ongeki_static_gachas {
ceilingCnt Int? @default(10)
changeRateCnt1 Int? @default(0)
changeRateCnt2 Int? @default(0)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
convertEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
convertEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
@@unique([version, gachaId, gachaName], map: "ongeki_static_gachas_uk")
}

View File

@ -318,7 +318,7 @@ model chuni_item_login_bonus {
version Int
presetId Int
bonusCount Int @default(0)
lastUpdateDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
lastUpdateDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
isWatched Boolean? @default(false)
isFinished Boolean? @default(false)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, map: "chuni_item_login_bonus_ibfk_1")
@ -402,7 +402,7 @@ model chuni_item_print_state {
id Int @id @default(autoincrement())
user Int
hasCompleted Boolean @default(false)
limitDate DateTime @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
limitDate DateTime @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
placeId Int?
cardId Int?
gachaId Int?
@ -958,10 +958,10 @@ model chuni_static_gachas {
ceilingCnt Int? @default(10)
changeRateCnt1 Int? @default(0)
changeRateCnt2 Int? @default(0)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
@@unique([version, gachaId, gachaName], map: "chuni_static_gachas_uk")
}
@ -1067,7 +1067,7 @@ model cozynet_chuni_static_trophies {
model cozynet_rival_codes {
id Int @id
rival_code Int?
aime_user aime_user @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cozynet_rival_codes_ibfk_1")
aime_user aime_user @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cozynet_rival_codes_ibfk_1")
}
model cxb_playlog {
@ -1087,7 +1087,7 @@ model cxb_playlog {
fail Int?
combo Int?
date_scored DateTime? @default(now()) @db.Timestamp(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_playlog_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_playlog_ibfk_1")
@@index([user], map: "user")
}
@ -1099,7 +1099,7 @@ model cxb_profile {
version Int
index Int
data String @db.LongText
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_profile_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_profile_ibfk_1")
@@unique([user, index], map: "cxb_profile_uk")
}
@ -1111,7 +1111,7 @@ model cxb_ranking {
song_id Int?
score Int?
clear Int?
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_ranking_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_ranking_ibfk_1")
@@unique([user, rev_id], map: "cxb_ranking_uk")
}
@ -1120,7 +1120,7 @@ model cxb_rev_energy {
id Int @id @default(autoincrement())
user Int @unique(map: "cxb_rev_energy_uk")
energy Int @default(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_rev_energy_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_rev_energy_ibfk_1")
}
/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
@ -1131,7 +1131,7 @@ model cxb_score {
song_mcode String? @db.VarChar(7)
song_index Int?
data String? @db.LongText
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "cxb_score_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "cxb_score_ibfk_1")
@@unique([user, song_mcode, song_index], map: "cxb_score_uk")
}
@ -1168,7 +1168,7 @@ model diva_playlog {
worst Int?
max_combo Int?
date_scored DateTime? @default(now()) @db.Timestamp(0)
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "diva_playlog_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "diva_playlog_ibfk_1")
@@index([user], map: "user")
}
@ -1288,7 +1288,7 @@ model diva_score {
sad Int?
worst Int?
max_combo Int?
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "diva_score_ibfk_1")
aime_user aime_user @relation(fields: [user], references: [id], onDelete: Cascade, onUpdate: Restrict, map: "diva_score_ibfk_1")
@@unique([user, pv_id, difficulty, edition], map: "diva_score_uk")
}
@ -2372,10 +2372,10 @@ model mai2_static_cards {
version Int
cardId Int
cardName String @db.VarChar(255)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
enabled Boolean? @default(true)
@@unique([version, cardId, cardName], map: "mai2_static_cards_uk")
@ -3085,11 +3085,11 @@ model ongeki_static_gachas {
ceilingCnt Int? @default(10)
changeRateCnt1 Int? @default(0)
changeRateCnt2 Int? @default(0)
startDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("'2018-01-01 00:00:00'")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
convertEndDate DateTime? @default(dbgenerated("'2038-01-01 00:00:00'")) @db.Timestamp(0)
startDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
endDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
noticeStartDate DateTime? @default(dbgenerated("('2017-12-31 19:00:00')")) @db.Timestamp(0)
noticeEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
convertEndDate DateTime? @default(dbgenerated("('2037-12-31 19:00:00')")) @db.Timestamp(0)
@@unique([version, gachaId, gachaName], map: "ongeki_static_gachas_uk")
}

View File

@ -151,7 +151,7 @@ const config = {
"value": "prisma-client-js"
},
"output": {
"value": "C:\\Users\\polaris\\Documents\\daphnis\\prisma\\schemas\\daphnis\\generated\\daphnis",
"value": "/home/polaris/projects/daphnis/prisma/schemas/daphnis/generated/daphnis",
"fromEnvVar": null
},
"config": {
@ -160,12 +160,12 @@ const config = {
"binaryTargets": [
{
"fromEnvVar": null,
"value": "windows",
"value": "debian-openssl-3.0.x",
"native": true
}
],
"previewFeatures": [],
"sourceFilePath": "C:\\Users\\polaris\\Documents\\daphnis\\prisma\\schemas\\daphnis\\schema.prisma",
"sourceFilePath": "/home/polaris/projects/daphnis/prisma/schemas/daphnis/schema.prisma",
"isCustomOutput": true
},
"relativeEnvPaths": {

View File

@ -152,7 +152,7 @@ const config = {
"value": "prisma-client-js"
},
"output": {
"value": "C:\\Users\\polaris\\Documents\\daphnis\\prisma\\schemas\\daphnis\\generated\\daphnis",
"value": "/home/polaris/projects/daphnis/prisma/schemas/daphnis/generated/daphnis",
"fromEnvVar": null
},
"config": {
@ -161,12 +161,12 @@ const config = {
"binaryTargets": [
{
"fromEnvVar": null,
"value": "windows",
"value": "debian-openssl-3.0.x",
"native": true
}
],
"previewFeatures": [],
"sourceFilePath": "C:\\Users\\polaris\\Documents\\daphnis\\prisma\\schemas\\daphnis\\schema.prisma",
"sourceFilePath": "/home/polaris/projects/daphnis/prisma/schemas/daphnis/schema.prisma",
"isCustomOutput": true
},
"relativeEnvPaths": {
@ -228,8 +228,8 @@ exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)
// file annotations for bundling tools to include these files
path.join(__dirname, "query_engine-windows.dll.node");
path.join(process.cwd(), "prisma/schemas/daphnis/generated/daphnis/query_engine-windows.dll.node")
path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node");
path.join(process.cwd(), "prisma/schemas/daphnis/generated/daphnis/libquery_engine-debian-openssl-3.0.x.so.node")
// file annotations for bundling tools to include these files
path.join(__dirname, "schema.prisma");
path.join(process.cwd(), "prisma/schemas/daphnis/generated/daphnis/schema.prisma")

View File

@ -1,24 +0,0 @@
-- CreateTable
CREATE TABLE `User` (
`id` VARCHAR(191) NOT NULL,
`username` VARCHAR(191) NOT NULL,
`accessCode` VARCHAR(191) NOT NULL,
`hashedPassword` VARCHAR(191) NOT NULL,
`role` ENUM('ADMIN', 'USER') NOT NULL DEFAULT 'USER',
UNIQUE INDEX `User_username_key`(`username`),
UNIQUE INDEX `User_accessCode_key`(`accessCode`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Session` (
`id` VARCHAR(191) NOT NULL,
`expiresAt` DATETIME(3) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -1,27 +0,0 @@
/*
Warnings:
- A unique constraint covering the columns `[email]` on the table `User` will be added. If there are existing duplicate values, this will fail.
- Added the required column `email` to the `User` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `User` ADD COLUMN `email` VARCHAR(191) NOT NULL;
-- CreateTable
CREATE TABLE `PasswordResetToken` (
`id` VARCHAR(191) NOT NULL,
`token` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`resetAt` DATETIME(3) NULL,
`userId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `PasswordResetToken_token_key`(`token`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateIndex
CREATE UNIQUE INDEX `User_email_key` ON `User`(`email`);
-- AddForeignKey
ALTER TABLE `PasswordResetToken` ADD CONSTRAINT `PasswordResetToken_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -1,11 +0,0 @@
/*
Warnings:
- The primary key for the `PasswordResetToken` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to alter the column `id` on the `PasswordResetToken` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Int`.
*/
-- AlterTable
ALTER TABLE `PasswordResetToken` DROP PRIMARY KEY,
MODIFY `id` INTEGER NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (`id`);

View File

@ -1,10 +0,0 @@
/*
Warnings:
- The primary key for the `PasswordResetToken` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- AlterTable
ALTER TABLE `PasswordResetToken` DROP PRIMARY KEY,
MODIFY `id` VARCHAR(191) NOT NULL,
ADD PRIMARY KEY (`id`);

View File

@ -1,18 +0,0 @@
-- CreateTable
CREATE TABLE `LinkSharingToken` (
`id` VARCHAR(191) NOT NULL,
`token` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`resetAt` DATETIME(3) NULL,
`userId` VARCHAR(191) NOT NULL,
`passwordResetTokenId` VARCHAR(191) NULL,
UNIQUE INDEX `LinkSharingToken_token_key`(`token`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `LinkSharingToken` ADD CONSTRAINT `LinkSharingToken_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `LinkSharingToken` ADD CONSTRAINT `LinkSharingToken_passwordResetTokenId_fkey` FOREIGN KEY (`passwordResetTokenId`) REFERENCES `PasswordResetToken`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -1,15 +0,0 @@
/*
Warnings:
- You are about to drop the column `passwordResetTokenId` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE `LinkSharingToken` DROP FOREIGN KEY `LinkSharingToken_passwordResetTokenId_fkey`;
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `passwordResetTokenId`,
ADD COLUMN `ShareTokenId` VARCHAR(191) NULL;
-- AddForeignKey
ALTER TABLE `LinkSharingToken` ADD CONSTRAINT `LinkSharingToken_ShareTokenId_fkey` FOREIGN KEY (`ShareTokenId`) REFERENCES `PasswordResetToken`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -1,9 +0,0 @@
/*
Warnings:
- You are about to drop the column `resetAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `resetAt`,
ADD COLUMN `sharedAt` DATETIME(3) NULL;

View File

@ -1,17 +0,0 @@
/*
Warnings:
- You are about to drop the column `ShareTokenId` on the `LinkSharingToken` table. All the data in the column will be lost.
- You are about to drop the column `sharedAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE `LinkSharingToken` DROP FOREIGN KEY `LinkSharingToken_ShareTokenId_fkey`;
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `ShareTokenId`,
DROP COLUMN `sharedAt`,
ADD COLUMN `passwordResetTokenId` VARCHAR(191) NULL;
-- AddForeignKey
ALTER TABLE `LinkSharingToken` ADD CONSTRAINT `LinkSharingToken_passwordResetTokenId_fkey` FOREIGN KEY (`passwordResetTokenId`) REFERENCES `PasswordResetToken`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -1,2 +0,0 @@
-- DropForeignKey
ALTER TABLE `LinkSharingToken` DROP FOREIGN KEY `LinkSharingToken_passwordResetTokenId_fkey`;

View File

@ -1,11 +0,0 @@
/*
Warnings:
- You are about to drop the column `passwordResetTokenId` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- DropIndex
DROP INDEX `LinkSharingToken_passwordResetTokenId_fkey` ON `LinkSharingToken`;
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `passwordResetTokenId`;

View File

@ -1,8 +0,0 @@
/*
Warnings:
- Added the required column `expiresAt` to the `LinkSharingToken` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` ADD COLUMN `expiresAt` DATETIME(3) NOT NULL;

View File

@ -1,8 +0,0 @@
/*
Warnings:
- You are about to drop the column `expiresAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `expiresAt`;

View File

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE `LinkSharingToken` ADD COLUMN `expiresAt` DATETIME(3) NULL;

View File

@ -1,8 +0,0 @@
/*
Warnings:
- You are about to drop the column `expiresAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `expiresAt`;

View File

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE `LinkSharingToken` ADD COLUMN `resetAt` DATETIME(3) NULL;

View File

@ -1,9 +0,0 @@
/*
Warnings:
- You are about to drop the column `resetAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `resetAt`,
ADD COLUMN `TokenExpiredAt` DATETIME(3) NULL;

View File

@ -1,10 +0,0 @@
/*
Warnings:
- You are about to drop the column `TokenExpiredAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `TokenExpiredAt`,
ADD COLUMN `playlogId` INTEGER NULL,
ADD COLUMN `tokenExpiredAt` DATETIME(3) NULL;

View File

@ -1,8 +0,0 @@
/*
Warnings:
- You are about to drop the column `tokenExpiredAt` on the `LinkSharingToken` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `LinkSharingToken` DROP COLUMN `tokenExpiredAt`;

View File

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE `LinkSharingToken` ADD COLUMN `tokenExpiredAt` DATETIME(3) NULL;

View File

@ -1,12 +0,0 @@
/*
Warnings:
- A unique constraint covering the columns `[UserId]` on the table `User` will be added. If there are existing duplicate values, this will fail.
- Added the required column `UserId` to the `User` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `User` ADD COLUMN `UserId` INTEGER NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `User_UserId_key` ON `User`(`UserId`);

View File

@ -0,0 +1,59 @@
-- CreateTable
CREATE TABLE `User` (
`id` VARCHAR(191) NOT NULL,
`username` VARCHAR(191) NOT NULL,
`accessCode` VARCHAR(191) NOT NULL,
`UserId` INTEGER NOT NULL,
`hashedPassword` VARCHAR(191) NOT NULL,
`email` VARCHAR(191) NOT NULL,
`role` ENUM('ADMIN', 'USER') NOT NULL DEFAULT 'USER',
UNIQUE INDEX `User_username_key`(`username`),
UNIQUE INDEX `User_accessCode_key`(`accessCode`),
UNIQUE INDEX `User_UserId_key`(`UserId`),
UNIQUE INDEX `User_email_key`(`email`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `PasswordResetToken` (
`id` VARCHAR(191) NOT NULL,
`token` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`userId` VARCHAR(191) NOT NULL,
`resetAt` DATETIME(3) NULL,
UNIQUE INDEX `PasswordResetToken_token_key`(`token`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `LinkSharingToken` (
`id` VARCHAR(191) NOT NULL,
`token` VARCHAR(191) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`userId` VARCHAR(191) NOT NULL,
`tokenExpiredAt` DATETIME(3) NULL,
`playlogId` INTEGER NULL,
UNIQUE INDEX `LinkSharingToken_token_key`(`token`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Session` (
`id` VARCHAR(191) NOT NULL,
`expiresAt` DATETIME(3) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `PasswordResetToken` ADD CONSTRAINT `PasswordResetToken_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `LinkSharingToken` ADD CONSTRAINT `LinkSharingToken_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;