42 lines
1.7 KiB
MySQL
42 lines
1.7 KiB
MySQL
|
-- DropForeignKey
|
||
|
ALTER TABLE "Member" DROP CONSTRAINT "Member_guildId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "Member" DROP CONSTRAINT "Member_userId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "Message" DROP CONSTRAINT "Message_channelId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "Message" DROP CONSTRAINT "Message_memberId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "OAuth" DROP CONSTRAINT "OAuth_userId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "RefreshToken" DROP CONSTRAINT "RefreshToken_userId_fkey";
|
||
|
|
||
|
-- DropForeignKey
|
||
|
ALTER TABLE "UserSetting" DROP CONSTRAINT "UserSetting_userId_fkey";
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "UserSetting" ADD CONSTRAINT "UserSetting_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "OAuth" ADD CONSTRAINT "OAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "Member" ADD CONSTRAINT "Member_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "Member" ADD CONSTRAINT "Member_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "Message" ADD CONSTRAINT "Message_memberId_fkey" FOREIGN KEY ("memberId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "Message" ADD CONSTRAINT "Message_channelId_fkey" FOREIGN KEY ("channelId") REFERENCES "Channel"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|