diff --git a/prisma/migrations/20241107151131_compound_id_for_reporting_periods/migration.sql b/prisma/migrations/20241107151131_compound_id_for_reporting_periods/migration.sql index 63c3b174..ba94b10a 100644 --- a/prisma/migrations/20241107151131_compound_id_for_reporting_periods/migration.sql +++ b/prisma/migrations/20241107151131_compound_id_for_reporting_periods/migration.sql @@ -1,19 +1,11 @@ /* Warnings: - - You are about to drop the column `reportingPeriodId` on the `Goal` table. All the data in the column will be lost. - - You are about to drop the column `reportingPeriodId` on the `Initiative` table. All the data in the column will be lost. - The primary key for the `ReportingPeriod` table will be changed. If it partially fails, the table could be left without primary key constraint. - You are about to drop the column `id` on the `ReportingPeriod` table. All the data in the column will be lost. - Added the required column `year` to the `ReportingPeriod` table without a default value. This is not possible if the table is not empty. */ --- DropForeignKey -ALTER TABLE "Goal" DROP CONSTRAINT "Goal_reportingPeriodId_fkey"; - --- DropForeignKey -ALTER TABLE "Initiative" DROP CONSTRAINT "Initiative_reportingPeriodId_fkey"; - -- AlterTable ALTER TABLE "Goal" DROP COLUMN "reportingPeriodId"; @@ -28,9 +20,3 @@ ALTER TABLE "ReportingPeriod" ALTER COLUMN "year" SET NOT NULL; ALTER TABLE "ReportingPeriod" DROP CONSTRAINT "ReportingPeriod_pkey", DROP COLUMN "id", ADD CONSTRAINT "ReportingPeriod_pkey" PRIMARY KEY ("companyId", "year"); - --- AddForeignKey -ALTER TABLE "Goal" ADD CONSTRAINT "Goal_companyId_year_fkey" FOREIGN KEY ("companyId", "year") REFERENCES "ReportingPeriod"("companyId", "year") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Initiative" ADD CONSTRAINT "Initiative_companyId_year_fkey" FOREIGN KEY ("companyId", "year") REFERENCES "ReportingPeriod"("companyId", "year") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20241107155138_disconnect_reporting_period_from_goals_and_initiatives/migration.sql b/prisma/migrations/20241107155138_disconnect_reporting_period_from_goals_and_initiatives/migration.sql deleted file mode 100644 index 92977d22..00000000 --- a/prisma/migrations/20241107155138_disconnect_reporting_period_from_goals_and_initiatives/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- DropForeignKey -ALTER TABLE "Goal" DROP CONSTRAINT "Goal_companyId_year_fkey"; - --- DropForeignKey -ALTER TABLE "Initiative" DROP CONSTRAINT "Initiative_companyId_year_fkey";