initial
[sketchy-heroes.git] / prisma / migrations / 20220314140620_remove_zones / migration.sql
1 /*
2   Warnings:
3
4   - You are about to drop the column `end_x` on the `ZoneBiomes` table. All the data in the column will be lost.
5   - You are about to drop the column `end_y` on the `ZoneBiomes` table. All the data in the column will be lost.
6   - You are about to drop the column `start_x` on the `ZoneBiomes` table. All the data in the column will be lost.
7   - You are about to drop the column `start_y` on the `ZoneBiomes` table. All the data in the column will be lost.
8   - You are about to drop the column `zoneId` on the `ZoneBiomes` table. All the data in the column will be lost.
9   - You are about to drop the `Zone` table. If the table is not empty, all the data it contains will be lost.
10   - Added the required column `zoneBiomeId` to the `Player` table without a default value. This is not possible if the table is not empty.
11   - Added the required column `playerId` to the `ZoneBiomes` table without a default value. This is not possible if the table is not empty.
12   - Added the required column `steps` to the `ZoneBiomes` table without a default value. This is not possible if the table is not empty.
13
14 */
15 -- DropForeignKey
16 ALTER TABLE "ZoneBiomes" DROP CONSTRAINT "ZoneBiomes_zoneId_fkey";
17
18 -- AlterTable
19 ALTER TABLE "Player" ADD COLUMN     "location_x" INTEGER NOT NULL DEFAULT 500,
20 ADD COLUMN     "location_y" INTEGER NOT NULL DEFAULT 500,
21 ADD COLUMN     "steps" INTEGER NOT NULL DEFAULT 0,
22 ADD COLUMN     "zoneBiomeId" UUID NOT NULL;
23
24 -- AlterTable
25 ALTER TABLE "ZoneBiomes" DROP COLUMN "end_x",
26 DROP COLUMN "end_y",
27 DROP COLUMN "start_x",
28 DROP COLUMN "start_y",
29 DROP COLUMN "zoneId",
30 ADD COLUMN     "playerId" UUID NOT NULL,
31 ADD COLUMN     "steps" INTEGER NOT NULL;
32
33 -- DropTable
34 DROP TABLE "Zone";
35
36 -- AddForeignKey
37 ALTER TABLE "Player" ADD CONSTRAINT "Player_zoneBiomeId_fkey" FOREIGN KEY ("zoneBiomeId") REFERENCES "ZoneBiomes"("id") ON DELETE RESTRICT ON UPDATE CASCADE;