mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-08 00:44:29 +01:00
fix: regenerate migration file + fix after rebase dev
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[image_id]` on the table `Award` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[cover_image_id]` on the table `Category` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[cover_image_id]` on the table `Hackathon` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[thumbnail_image_id]` on the table `Project` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[cover_image_id]` on the table `Project` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[cover_image_id]` on the table `Story` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[avatar_id]` on the table `User` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Award" ADD COLUMN "image_id" INTEGER;
|
||||
|
||||
@@ -19,6 +31,27 @@ ADD COLUMN "cover_image_id" INTEGER;
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "avatar_id" INTEGER;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Award_image_id_key" ON "Award"("image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Category_cover_image_id_key" ON "Category"("cover_image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Hackathon_cover_image_id_key" ON "Hackathon"("cover_image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Project_thumbnail_image_id_key" ON "Project"("thumbnail_image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Project_cover_image_id_key" ON "Project"("cover_image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Story_cover_image_id_key" ON "Story"("cover_image_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_avatar_id_key" ON "User"("avatar_id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "User" ADD CONSTRAINT "User_avatar_id_fkey" FOREIGN KEY ("avatar_id") REFERENCES "HostedImage"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
@@ -44,8 +44,8 @@ model User {
|
||||
pubKey String? @unique
|
||||
name String?
|
||||
avatar String?
|
||||
avatar_id Int?
|
||||
avatar_rel HostedImage? @relation("UserAvatar", fields: [avatar_id], references: [id])
|
||||
avatar_id Int? @unique
|
||||
avatar_rel HostedImage? @relation("User_Avatar", fields: [avatar_id], references: [id])
|
||||
role String @default("user")
|
||||
|
||||
email String?
|
||||
@@ -117,8 +117,8 @@ model Category {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
cover_image String?
|
||||
cover_image_id Int?
|
||||
cover_image_rel HostedImage? @relation("CategoryCoverImage", fields: [cover_image_id], references: [id])
|
||||
cover_image_id Int? @unique
|
||||
cover_image_rel HostedImage? @relation("Category_CoverImage", fields: [cover_image_id], references: [id])
|
||||
icon String?
|
||||
|
||||
project Project[]
|
||||
@@ -132,11 +132,11 @@ model Project {
|
||||
screenshots_ids Int[]
|
||||
website String
|
||||
thumbnail_image String?
|
||||
thumbnail_image_id Int?
|
||||
thumbnail_image_rel HostedImage? @relation("ProjectThumbnail", fields: [thumbnail_image_id], references: [id])
|
||||
thumbnail_image_id Int? @unique
|
||||
thumbnail_image_rel HostedImage? @relation("Project_Thumbnail", fields: [thumbnail_image_id], references: [id])
|
||||
cover_image String?
|
||||
cover_image_id Int?
|
||||
cover_image_rel HostedImage? @relation("ProjectCoverImage", fields: [cover_image_id], references: [id])
|
||||
cover_image_id Int? @unique
|
||||
cover_image_rel HostedImage? @relation("Project_CoverImage", fields: [cover_image_id], references: [id])
|
||||
lightning_address String?
|
||||
lnurl_callback_url String?
|
||||
|
||||
@@ -167,8 +167,8 @@ model Award {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
image String
|
||||
image_id Int?
|
||||
image_rel HostedImage? @relation("AwardImage", fields: [image_id], references: [id])
|
||||
image_id Int? @unique
|
||||
image_rel HostedImage? @relation("Award_Image", fields: [image_id], references: [id])
|
||||
url String
|
||||
|
||||
project Project @relation(fields: [project_id], references: [id])
|
||||
@@ -188,8 +188,8 @@ model Story {
|
||||
body_image_ids Int[]
|
||||
excerpt String
|
||||
cover_image String?
|
||||
cover_image_id Int?
|
||||
cover_image_rel HostedImage? @relation("StoryCoverImage", fields: [cover_image_id], references: [id])
|
||||
cover_image_id Int? @unique
|
||||
cover_image_rel HostedImage? @relation("Story_CoverImage", fields: [cover_image_id], references: [id])
|
||||
votes_count Int @default(0)
|
||||
is_published Boolean @default(true)
|
||||
|
||||
@@ -249,8 +249,8 @@ model Hackathon {
|
||||
start_date DateTime @db.Date
|
||||
end_date DateTime @db.Date
|
||||
cover_image String
|
||||
cover_image_id Int?
|
||||
cover_image_rel HostedImage? @relation("HackathonCoverImage", fields: [cover_image_id], references: [id])
|
||||
cover_image_id Int? @unique
|
||||
cover_image_rel HostedImage? @relation("Hackathon_CoverImage", fields: [cover_image_id], references: [id])
|
||||
description String
|
||||
location String
|
||||
website String
|
||||
@@ -296,13 +296,13 @@ model HostedImage {
|
||||
createdAt DateTime @default(now())
|
||||
is_used Boolean @default(false)
|
||||
|
||||
ProjectThumbnail Project[] @relation("ProjectThumbnail")
|
||||
ProjectCoverImage Project[] @relation("ProjectCoverImage")
|
||||
CategoryCoverImage Category[] @relation("CategoryCoverImage")
|
||||
AwardImage Award[] @relation("AwardImage")
|
||||
HackathonCoverImage Hackathon[] @relation("HackathonCoverImage")
|
||||
StoryCoverImage Story[] @relation("StoryCoverImage")
|
||||
User User[] @relation("UserAvatar")
|
||||
ProjectThumbnail Project? @relation("Project_Thumbnail")
|
||||
ProjectCoverImage Project? @relation("Project_CoverImage")
|
||||
CategoryCoverImage Category? @relation("Category_CoverImage")
|
||||
AwardImage Award? @relation("Award_Image")
|
||||
HackathonCoverImage Hackathon? @relation("Hackathon_CoverImage")
|
||||
StoryCoverImage Story? @relation("Story_CoverImage")
|
||||
User User? @relation("User_Avatar")
|
||||
}
|
||||
|
||||
// -----------------
|
||||
|
||||
Reference in New Issue
Block a user