/*
  Warnings:

  - You are about to drop the column `player_id` on the `AuthToken` table. All the data in the column will be lost.
  - You are about to drop the column `stat_points` on the `Player` table. All the data in the column will be lost.
  - A unique constraint covering the columns `[playerId]` on the table `AuthToken` will be added. If there are existing duplicate values, this will fail.
  - Added the required column `playerId` to the `AuthToken` table without a default value. This is not possible if the table is not empty.

*/
-- DropForeignKey
ALTER TABLE "AuthToken" DROP CONSTRAINT "AuthToken_player_id_fkey";

-- DropIndex
DROP INDEX "AuthToken_player_id_key";

-- AlterTable
ALTER TABLE "AuthToken" DROP COLUMN "player_id",
ADD COLUMN     "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN     "playerId" UUID NOT NULL,
ADD COLUMN     "updatedAt" TIMESTAMP(3);

-- AlterTable
ALTER TABLE "Player" DROP COLUMN "stat_points",
ADD COLUMN     "statPoints" INTEGER NOT NULL DEFAULT 0;

-- CreateIndex
CREATE UNIQUE INDEX "AuthToken_playerId_key" ON "AuthToken"("playerId");

-- AddForeignKey
ALTER TABLE "AuthToken" ADD CONSTRAINT "AuthToken_playerId_fkey" FOREIGN KEY ("playerId") REFERENCES "Player"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
