/*
  Warnings:

  - You are about to alter the column `ownerId` on the `clubs` table. The data in that column could be lost. The data in that column will be cast from `UnsignedBigInt` to `VarChar(255)`.
  - You are about to alter the column `ownerId` on the `players` table. The data in that column could be lost. The data in that column will be cast from `UnsignedBigInt` to `VarChar(255)`.
  - The primary key for the `users` table will be changed. If it partially fails, the table could be left without primary key constraint.
  - You are about to alter the column `id` on the `users` table. The data in that column could be lost. The data in that column will be cast from `UnsignedBigInt` to `VarChar(255)`.

*/
-- DropForeignKey
ALTER TABLE `clubs` DROP FOREIGN KEY `clubs_ownerId_fkey`;

-- DropForeignKey
ALTER TABLE `players` DROP FOREIGN KEY `players_ownerId_fkey`;

-- AlterTable
ALTER TABLE `clubs` MODIFY `ownerId` VARCHAR(255) NOT NULL;

-- AlterTable
ALTER TABLE `players` MODIFY `ownerId` VARCHAR(255) NOT NULL;

-- AlterTable
ALTER TABLE `users` DROP PRIMARY KEY,
    MODIFY `id` VARCHAR(255) NOT NULL,
    ADD PRIMARY KEY (`id`);

-- AddForeignKey
ALTER TABLE `clubs` ADD CONSTRAINT `clubs_ownerId_fkey` FOREIGN KEY (`ownerId`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `players` ADD CONSTRAINT `players_ownerId_fkey` FOREIGN KEY (`ownerId`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
