/*
  Warnings:

  - Made the column `userId` on table `transaction` required. This step will fail if there are existing NULL values in that column.

*/
-- DropForeignKey
ALTER TABLE `guildmember` DROP FOREIGN KEY `GuildMember_memberId_fkey`;

-- DropForeignKey
ALTER TABLE `transaction` DROP FOREIGN KEY `Transaction_userId_fkey`;

-- DropForeignKey
ALTER TABLE `transactiondetail` DROP FOREIGN KEY `TransactionDetail_transactionId_fkey`;

-- DropForeignKey
ALTER TABLE `waypoint` DROP FOREIGN KEY `WayPoint_ownerId_fkey`;

-- AlterTable
ALTER TABLE `guildmember` MODIFY `memberId` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `transaction` MODIFY `userId` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `user` MODIFY `xuid` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `waypoint` MODIFY `ownerId` VARCHAR(191) NOT NULL;

-- AddForeignKey
ALTER TABLE `GuildMember` ADD CONSTRAINT `GuildMember_memberId_fkey` FOREIGN KEY (`memberId`) REFERENCES `User`(`xuid`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Transaction` ADD CONSTRAINT `Transaction_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`xuid`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `TransactionDetail` ADD CONSTRAINT `TransactionDetail_transactionId_fkey` FOREIGN KEY (`transactionId`) REFERENCES `Transaction`(`transactionId`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `WayPoint` ADD CONSTRAINT `WayPoint_ownerId_fkey` FOREIGN KEY (`ownerId`) REFERENCES `User`(`xuid`) ON DELETE CASCADE ON UPDATE CASCADE;
