[offers][chore] Add reference to analysed offer in analysis unit (#504)
Co-authored-by: Bryann Yeap Kok Keong <bryannyeapkk@gmail.com>pull/511/head
parent
a7b4daec21
commit
80fd274662
@ -0,0 +1,16 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `companyId` on the `OffersAnalysisUnit` table. All the data in the column will be lost.
|
||||
- Added the required column `analysedOfferId` to the `OffersAnalysisUnit` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "OffersAnalysisUnit" DROP CONSTRAINT "OffersAnalysisUnit_companyId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "OffersAnalysisUnit" DROP COLUMN "companyId",
|
||||
ADD COLUMN "analysedOfferId" TEXT NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "OffersAnalysisUnit" ADD CONSTRAINT "OffersAnalysisUnit_analysedOfferId_fkey" FOREIGN KEY ("analysedOfferId") REFERENCES "OffersOffer"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
@ -0,0 +1,171 @@
|
||||
export const analysisInclusion = {
|
||||
companyAnalysis: {
|
||||
include: {
|
||||
analysedOffer: {
|
||||
include: {
|
||||
company: true,
|
||||
offersFullTime: {
|
||||
include: {
|
||||
totalCompensation: true,
|
||||
},
|
||||
},
|
||||
offersIntern: {
|
||||
include: {
|
||||
monthlySalary: true,
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
include: {
|
||||
background: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
topSimilarOffers: {
|
||||
include: {
|
||||
company: true,
|
||||
location: {
|
||||
include: {
|
||||
state: {
|
||||
include: {
|
||||
country: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
offersFullTime: {
|
||||
include: {
|
||||
totalCompensation: true,
|
||||
},
|
||||
},
|
||||
offersIntern: {
|
||||
include: {
|
||||
monthlySalary: true,
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
include: {
|
||||
background: {
|
||||
include: {
|
||||
experiences: {
|
||||
include: {
|
||||
company: true,
|
||||
location: {
|
||||
include: {
|
||||
state: {
|
||||
include: {
|
||||
country: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
overallAnalysis: {
|
||||
include: {
|
||||
analysedOffer: {
|
||||
include: {
|
||||
company: true,
|
||||
offersFullTime: {
|
||||
include: {
|
||||
totalCompensation: true,
|
||||
},
|
||||
},
|
||||
offersIntern: {
|
||||
include: {
|
||||
monthlySalary: true,
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
include: {
|
||||
background: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
topSimilarOffers: {
|
||||
include: {
|
||||
company: true,
|
||||
location: {
|
||||
include: {
|
||||
state: {
|
||||
include: {
|
||||
country: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
offersFullTime: {
|
||||
include: {
|
||||
totalCompensation: true,
|
||||
},
|
||||
},
|
||||
offersIntern: {
|
||||
include: {
|
||||
monthlySalary: true,
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
include: {
|
||||
background: {
|
||||
include: {
|
||||
experiences: {
|
||||
include: {
|
||||
company: true,
|
||||
location: {
|
||||
include: {
|
||||
state: {
|
||||
include: {
|
||||
country: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
overallHighestOffer: {
|
||||
include: {
|
||||
company: true,
|
||||
location: {
|
||||
include: {
|
||||
state: {
|
||||
include: {
|
||||
country: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
offersFullTime: {
|
||||
include: {
|
||||
totalCompensation: true,
|
||||
},
|
||||
},
|
||||
offersIntern: {
|
||||
include: {
|
||||
monthlySalary: true,
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
include: {
|
||||
background: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Reference in new issue