mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-08-03 04:04:24 +08:00
[questions][chore] update to use company table values (#351)
Co-authored-by: Jeff Sieu <jeffsy00@gmail.com>
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `company` on the `QuestionsQuestionEncounter` table. All the data in the column will be lost.
|
||||
- Added the required column `companyId` to the `QuestionsQuestionEncounter` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "QuestionsQuestionEncounter" DROP COLUMN "company",
|
||||
ADD COLUMN "companyId" TEXT NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "QuestionsQuestionEncounter" ADD CONSTRAINT "QuestionsQuestionEncounter_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "Company"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
@ -91,15 +91,17 @@ enum TodoStatus {
|
||||
}
|
||||
|
||||
model Company {
|
||||
id String @id @default(cuid())
|
||||
name String @db.Text
|
||||
slug String @unique
|
||||
description String? @db.Text
|
||||
logoUrl String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
OffersExperience OffersExperience[]
|
||||
OffersOffer OffersOffer[]
|
||||
id String @id @default(cuid())
|
||||
name String @db.Text
|
||||
slug String @unique
|
||||
description String? @db.Text
|
||||
logoUrl String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
questionsQuestionEncounter QuestionsQuestionEncounter[]
|
||||
OffersExperience OffersExperience[]
|
||||
OffersOffer OffersOffer[]
|
||||
}
|
||||
|
||||
// Start of Resumes project models.
|
||||
@ -403,19 +405,20 @@ model QuestionsQuestion {
|
||||
}
|
||||
|
||||
model QuestionsQuestionEncounter {
|
||||
id String @id @default(cuid())
|
||||
questionId String
|
||||
userId String?
|
||||
// TODO: sync with models
|
||||
company String @db.Text
|
||||
location String @db.Text
|
||||
role String @db.Text
|
||||
seenAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(cuid())
|
||||
questionId String
|
||||
userId String?
|
||||
// TODO: sync with models (location, role)
|
||||
companyId String
|
||||
location String @db.Text
|
||||
role String @db.Text
|
||||
seenAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
||||
question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
|
||||
company Company? @relation(fields: [companyId], references: [id], onDelete: SetNull)
|
||||
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
||||
question QuestionsQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model QuestionsQuestionVote {
|
||||
|
Reference in New Issue
Block a user