/*
  Warnings:

  - You are about to drop the `share_permition_request_accounts` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropForeignKey
ALTER TABLE "share_permition_request_accounts" DROP CONSTRAINT "share_permition_request_accounts_accountId_fkey";

-- DropForeignKey
ALTER TABLE "share_permition_request_accounts" DROP CONSTRAINT "share_permition_request_accounts_requestId_fkey";

-- DropTable
DROP TABLE "share_permition_request_accounts";

-- CreateTable
CREATE TABLE "share_permission_request_accounts" (
    "id" SERIAL NOT NULL,
    "createDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updateDate" TIMESTAMP(3) NOT NULL,
    "requestId" INTEGER NOT NULL,
    "accountId" INTEGER NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "share_permission_request_accounts_id_key" ON "share_permission_request_accounts"("id");

-- AddForeignKey
ALTER TABLE "share_permission_request_accounts" ADD CONSTRAINT "share_permission_request_accounts_requestId_fkey" FOREIGN KEY ("requestId") REFERENCES "share_permition_request"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "share_permission_request_accounts" ADD CONSTRAINT "share_permission_request_accounts_accountId_fkey" FOREIGN KEY ("accountId") REFERENCES "account"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
