-- CreateEnum
CREATE TYPE "EVENT_TYPE" AS ENUM ('COURSE', 'PILOT_STARTER', 'DISPATCH_STARTER', 'EVENT');

-- CreateEnum
CREATE TYPE "KEYWORD_CATEGORY" AS ENUM ('AB_ATMUNG', 'C_KREISLAUF', 'D_NEUROLOGISCH', 'E_TRAUMA_SONSTIGES', 'K_KIND', 'M_BERGRETTUNG', 'P_PSYCHIATRISCH', 'V_VERLETZUNG', 'W_WASSERRETTUNG', 'Z_SONSTIGES');

-- CreateEnum
CREATE TYPE "missionType" AS ENUM ('primär', 'sekundär');

-- CreateEnum
CREATE TYPE "MissionState" AS ENUM ('running', 'finished', 'draft');

-- CreateEnum
CREATE TYPE "HpgState" AS ENUM ('NOT_REQUESTED', 'ON_SCENE', 'DISPATCHED');

-- CreateEnum
CREATE TYPE "HpgValidationState" AS ENUM ('NOT_VALIDATED', 'PENDING', 'VALID', 'INVALID', 'HPG_DISCONNECT', 'HPG_BUSY', 'HPG_INVALID_MISSION', 'POSITION_AMANDED');

-- CreateEnum
CREATE TYPE "GlobalColor" AS ENUM ('PRIMARY', 'SECONDARY', 'INFO', 'SUCCESS', 'WARNING', 'ERROR');

-- CreateEnum
CREATE TYPE "PenaltyType" AS ENUM ('KICK', 'TIME_BAN', 'PERMISSIONS_REVOCED', 'BAN');

-- CreateEnum
CREATE TYPE "BosUse" AS ENUM ('PRIMARY', 'SECONDARY', 'DUAL_USE');

-- CreateEnum
CREATE TYPE "Country" AS ENUM ('DE', 'AT', 'CH');

-- CreateEnum
CREATE TYPE "BADGES" AS ENUM ('P1', 'P2', 'P3', 'D1', 'D2', 'D3', 'DAY1', 'V1Veteran');

-- CreateEnum
CREATE TYPE "PERMISSION" AS ENUM ('ADMIN_EVENT', 'ADMIN_USER', 'ADMIN_USER_ADVANCED', 'ADMIN_STATION', 'ADMIN_KEYWORD', 'ADMIN_MESSAGE', 'ADMIN_KICK', 'AUDIO', 'PILOT', 'DISPO');

-- CreateTable
CREATE TABLE "oauth_tokens" (
    "id" SERIAL NOT NULL,
    "user_id" TEXT NOT NULL,
    "client_id" TEXT NOT NULL,
    "access_token" TEXT NOT NULL,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "oauth_tokens_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ChatMessage" (
    "id" SERIAL NOT NULL,
    "text" TEXT NOT NULL,
    "senderId" TEXT NOT NULL,
    "receiverId" TEXT NOT NULL,
    "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "receiverName" TEXT NOT NULL,
    "senderName" TEXT NOT NULL,

    CONSTRAINT "ChatMessage_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ConnectedAircraft" (
    "id" SERIAL NOT NULL,
    "userId" TEXT NOT NULL,
    "publicUser" JSONB NOT NULL,
    "lastHeartbeat" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "fmsStatus" TEXT NOT NULL DEFAULT '6',
    "posLat" DOUBLE PRECISION,
    "posLng" DOUBLE PRECISION,
    "posAlt" INTEGER,
    "posSpeed" INTEGER,
    "posHeading" INTEGER,
    "simulator" TEXT,
    "posH145active" BOOLEAN NOT NULL DEFAULT false,
    "stationId" INTEGER NOT NULL,
    "loginTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "esimatedLogoutTime" TIMESTAMP(3),
    "logoutTime" TIMESTAMP(3),
    "positionLogIds" INTEGER[] DEFAULT ARRAY[]::INTEGER[],

    CONSTRAINT "ConnectedAircraft_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ConnectedDispatcher" (
    "id" SERIAL NOT NULL,
    "userId" TEXT NOT NULL,
    "publicUser" JSONB NOT NULL,
    "lastHeartbeat" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "loginTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "zone" TEXT NOT NULL DEFAULT 'LST_1',
    "esimatedLogoutTime" TIMESTAMP(3),
    "logoutTime" TIMESTAMP(3),

    CONSTRAINT "ConnectedDispatcher_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "EventAppointment" (
    "id" SERIAL NOT NULL,
    "eventId" INTEGER NOT NULL,
    "appointmentDate" TIMESTAMP(3) NOT NULL,
    "presenterId" TEXT NOT NULL,

    CONSTRAINT "EventAppointment_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Participant" (
    "id" SERIAL NOT NULL,
    "user_id" TEXT NOT NULL,
    "finisherMoodleCurseCompleted" BOOLEAN NOT NULL DEFAULT false,
    "attended" BOOLEAN NOT NULL DEFAULT false,
    "appointmentCancelled" BOOLEAN NOT NULL DEFAULT false,
    "eventAppointmentId" INTEGER,
    "enscriptionDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "statusLog" JSONB[] DEFAULT ARRAY[]::JSONB[],
    "eventId" INTEGER NOT NULL,

    CONSTRAINT "Participant_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Event" (
    "id" SERIAL NOT NULL,
    "name" TEXT NOT NULL,
    "description" TEXT NOT NULL,
    "type" "EVENT_TYPE" NOT NULL DEFAULT 'EVENT',
    "discordRoleId" TEXT DEFAULT '',
    "hasPresenceEvents" BOOLEAN NOT NULL DEFAULT false,
    "maxParticipants" INTEGER DEFAULT 0,
    "finisherMoodleCourseId" TEXT DEFAULT '',
    "finishedBadges" "BADGES"[] DEFAULT ARRAY[]::"BADGES"[],
    "requiredBadges" "BADGES"[] DEFAULT ARRAY[]::"BADGES"[],
    "finishedPermissions" "PERMISSION"[] DEFAULT ARRAY[]::"PERMISSION"[],
    "hidden" BOOLEAN NOT NULL DEFAULT true,

    CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "File" (
    "id" SERIAL NOT NULL,

    CONSTRAINT "File_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Keyword" (
    "id" SERIAL NOT NULL,
    "category" "KEYWORD_CATEGORY" NOT NULL,
    "abreviation" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "description" TEXT,
    "hpgMissionTypes" TEXT[],

    CONSTRAINT "Keyword_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Mission" (
    "id" SERIAL NOT NULL,
    "publicId" TEXT NOT NULL DEFAULT '',
    "type" "missionType" NOT NULL DEFAULT 'primär',
    "state" "MissionState" NOT NULL DEFAULT 'draft',
    "addressLat" DOUBLE PRECISION NOT NULL,
    "addressLng" DOUBLE PRECISION NOT NULL,
    "addressStreet" TEXT,
    "addressCity" TEXT,
    "addressZip" TEXT,
    "addressAdditionalInfo" TEXT DEFAULT '',
    "addressMissionDestination" TEXT DEFAULT '',
    "addressOSMways" JSONB[] DEFAULT ARRAY[]::JSONB[],
    "missionKeywordCategory" TEXT NOT NULL,
    "missionKeywordName" TEXT NOT NULL,
    "missionKeywordAbbreviation" TEXT NOT NULL,
    "missionPatientInfo" TEXT NOT NULL,
    "missionAdditionalInfo" TEXT NOT NULL,
    "missionStationIds" INTEGER[] DEFAULT ARRAY[]::INTEGER[],
    "missionStationUserIds" TEXT[] DEFAULT ARRAY[]::TEXT[],
    "missionLog" JSONB[] DEFAULT ARRAY[]::JSONB[],
    "hpgMissionString" TEXT,
    "hpgSelectedMissionString" TEXT,
    "hpgAmbulanceState" "HpgState" DEFAULT 'NOT_REQUESTED',
    "hpgFireEngineState" "HpgState" DEFAULT 'NOT_REQUESTED',
    "hpgPoliceState" "HpgState" DEFAULT 'NOT_REQUESTED',
    "hpgLocationLat" DOUBLE PRECISION DEFAULT 0,
    "hpgLocationLng" DOUBLE PRECISION DEFAULT 0,
    "hpgValidationState" "HpgValidationState" NOT NULL DEFAULT 'NOT_VALIDATED',
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,
    "createdUserId" TEXT,

    CONSTRAINT "Mission_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "MissionOnStationUsers" (
    "userId" TEXT NOT NULL,
    "missionId" INTEGER NOT NULL,
    "stationId" INTEGER NOT NULL
);

-- CreateTable
CREATE TABLE "MissionsOnStations" (
    "missionId" INTEGER NOT NULL,
    "stationId" INTEGER NOT NULL,

    CONSTRAINT "MissionsOnStations_pkey" PRIMARY KEY ("missionId","stationId")
);

-- CreateTable
CREATE TABLE "Notam" (
    "id" SERIAL NOT NULL,
    "color" "GlobalColor" NOT NULL,
    "message" TEXT NOT NULL,
    "showUntil" TIMESTAMP(3) NOT NULL,
    "isMainMsg" BOOLEAN NOT NULL,
    "active" BOOLEAN NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "Notam_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Penalty" (
    "id" SERIAL NOT NULL,
    "userId" TEXT NOT NULL,
    "createdUserId" TEXT,
    "reportId" INTEGER,
    "type" "PenaltyType" NOT NULL,
    "reason" TEXT NOT NULL,
    "until" TIMESTAMP(3),
    "suspended" BOOLEAN NOT NULL DEFAULT false,
    "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "Penalty_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "PositionLog" (
    "id" SERIAL NOT NULL,
    "userId" TEXT NOT NULL,
    "simulator" TEXT NOT NULL,
    "lat" DOUBLE PRECISION NOT NULL,
    "lng" DOUBLE PRECISION NOT NULL,
    "alt" INTEGER NOT NULL,
    "speed" INTEGER NOT NULL,
    "heading" INTEGER NOT NULL,
    "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "PositionLog_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Report" (
    "id" SERIAL NOT NULL,
    "text" TEXT NOT NULL,
    "senderUserId" TEXT,
    "reportedUserRole" TEXT NOT NULL DEFAULT 'KP',
    "reportedUserId" TEXT NOT NULL,
    "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "reviewerComment" TEXT,
    "reviewed" BOOLEAN NOT NULL DEFAULT false,
    "reviewerUserId" TEXT,

    CONSTRAINT "Report_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Station" (
    "id" SERIAL NOT NULL,
    "bosUse" "BosUse" NOT NULL,
    "bosCallsign" TEXT NOT NULL,
    "bosCallsignShort" TEXT NOT NULL,
    "bosRadioArea" TEXT NOT NULL,
    "country" "Country" NOT NULL,
    "operator" TEXT NOT NULL,
    "aircraft" TEXT NOT NULL,
    "aircraftRegistration" TEXT NOT NULL,
    "aircraftSpeed" INTEGER NOT NULL,
    "hasWinch" BOOLEAN NOT NULL,
    "is24h" BOOLEAN NOT NULL,
    "hasNvg" BOOLEAN NOT NULL,
    "locationState" TEXT NOT NULL,
    "locationStateShort" TEXT NOT NULL,
    "hasRope" BOOLEAN NOT NULL,
    "fir" TEXT NOT NULL,
    "latitude" DOUBLE PRECISION NOT NULL,
    "longitude" DOUBLE PRECISION NOT NULL,
    "atcCallsign" TEXT NOT NULL,
    "hideRangeRings" BOOLEAN NOT NULL,

    CONSTRAINT "Station_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "users" (
    "id" TEXT NOT NULL,
    "publicId" TEXT NOT NULL,
    "firstname" TEXT NOT NULL,
    "lastname" TEXT NOT NULL,
    "email" TEXT NOT NULL,
    "password" TEXT NOT NULL,
    "vatsim_cid" INTEGER,
    "moodle_id" INTEGER,
    "pathSelected" BOOLEAN NOT NULL DEFAULT false,
    "migratedFromV1" BOOLEAN NOT NULL DEFAULT false,
    "settings_ntfy_room" TEXT,
    "settings_mic_device" TEXT,
    "settings_mic_volume" DOUBLE PRECISION,
    "settings_dme_volume" DOUBLE PRECISION,
    "settings_funk_volume" DOUBLE PRECISION,
    "settings_hide_lastname" BOOLEAN NOT NULL DEFAULT false,
    "email_verification_token" TEXT,
    "email_verification_expires_at" TIMESTAMP(3),
    "emailVerified" BOOLEAN NOT NULL DEFAULT false,
    "image" TEXT,
    "badges" "BADGES"[] DEFAULT ARRAY[]::"BADGES"[],
    "permissions" "PERMISSION"[] DEFAULT ARRAY[]::"PERMISSION"[],
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "is_banned" BOOLEAN NOT NULL DEFAULT false,

    CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "discord_accounts" (
    "id" SERIAL NOT NULL,
    "discord_id" TEXT NOT NULL,
    "user_id" TEXT NOT NULL,
    "email" TEXT NOT NULL,
    "username" TEXT NOT NULL,
    "avatar" TEXT,
    "global_name" TEXT NOT NULL,
    "verified" BOOLEAN NOT NULL DEFAULT false,
    "access_token" TEXT,
    "refresh_token" TEXT NOT NULL,
    "token_type" TEXT NOT NULL,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "discord_accounts_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "_EventAppointmentUser" (
    "A" INTEGER NOT NULL,
    "B" TEXT NOT NULL,

    CONSTRAINT "_EventAppointmentUser_AB_pkey" PRIMARY KEY ("A","B")
);

-- CreateIndex
CREATE UNIQUE INDEX "oauth_tokens_access_token_key" ON "oauth_tokens"("access_token");

-- CreateIndex
CREATE UNIQUE INDEX "MissionOnStationUsers_userId_missionId_stationId_key" ON "MissionOnStationUsers"("userId", "missionId", "stationId");

-- CreateIndex
CREATE UNIQUE INDEX "users_publicId_key" ON "users"("publicId");

-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");

-- CreateIndex
CREATE UNIQUE INDEX "discord_accounts_discord_id_key" ON "discord_accounts"("discord_id");

-- CreateIndex
CREATE INDEX "_EventAppointmentUser_B_index" ON "_EventAppointmentUser"("B");

-- AddForeignKey
ALTER TABLE "oauth_tokens" ADD CONSTRAINT "oauth_tokens_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ChatMessage" ADD CONSTRAINT "ChatMessage_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ChatMessage" ADD CONSTRAINT "ChatMessage_receiverId_fkey" FOREIGN KEY ("receiverId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ConnectedAircraft" ADD CONSTRAINT "ConnectedAircraft_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ConnectedAircraft" ADD CONSTRAINT "ConnectedAircraft_stationId_fkey" FOREIGN KEY ("stationId") REFERENCES "Station"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ConnectedDispatcher" ADD CONSTRAINT "ConnectedDispatcher_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "EventAppointment" ADD CONSTRAINT "EventAppointment_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "EventAppointment" ADD CONSTRAINT "EventAppointment_presenterId_fkey" FOREIGN KEY ("presenterId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Participant" ADD CONSTRAINT "Participant_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Participant" ADD CONSTRAINT "Participant_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Participant" ADD CONSTRAINT "Participant_eventAppointmentId_fkey" FOREIGN KEY ("eventAppointmentId") REFERENCES "EventAppointment"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Mission" ADD CONSTRAINT "Mission_createdUserId_fkey" FOREIGN KEY ("createdUserId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "MissionOnStationUsers" ADD CONSTRAINT "MissionOnStationUsers_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "MissionOnStationUsers" ADD CONSTRAINT "MissionOnStationUsers_missionId_fkey" FOREIGN KEY ("missionId") REFERENCES "Mission"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "MissionOnStationUsers" ADD CONSTRAINT "MissionOnStationUsers_stationId_fkey" FOREIGN KEY ("stationId") REFERENCES "Station"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "MissionsOnStations" ADD CONSTRAINT "MissionsOnStations_missionId_fkey" FOREIGN KEY ("missionId") REFERENCES "Mission"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "MissionsOnStations" ADD CONSTRAINT "MissionsOnStations_stationId_fkey" FOREIGN KEY ("stationId") REFERENCES "Station"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Penalty" ADD CONSTRAINT "Penalty_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Penalty" ADD CONSTRAINT "Penalty_createdUserId_fkey" FOREIGN KEY ("createdUserId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Penalty" ADD CONSTRAINT "Penalty_reportId_fkey" FOREIGN KEY ("reportId") REFERENCES "Report"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "PositionLog" ADD CONSTRAINT "PositionLog_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Report" ADD CONSTRAINT "Report_senderUserId_fkey" FOREIGN KEY ("senderUserId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Report" ADD CONSTRAINT "Report_reportedUserId_fkey" FOREIGN KEY ("reportedUserId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Report" ADD CONSTRAINT "Report_reviewerUserId_fkey" FOREIGN KEY ("reviewerUserId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "discord_accounts" ADD CONSTRAINT "discord_accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "_EventAppointmentUser" ADD CONSTRAINT "_EventAppointmentUser_A_fkey" FOREIGN KEY ("A") REFERENCES "EventAppointment"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "_EventAppointmentUser" ADD CONSTRAINT "_EventAppointmentUser_B_fkey" FOREIGN KEY ("B") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
