Keyan 245419185f
wallet streaks (#1468)
* wallet streaks backend

* notifications and badges

* reuseable streak fragment

* squash migrations

* push notifications

* update cowboy notification setting label text
2024-10-11 19:14:18 -05:00

27 lines
757 B
SQL

-- CreateEnum
CREATE TYPE "StreakType" AS ENUM ('COWBOY_HAT', 'GUN', 'HORSE');
-- AlterTable
ALTER TABLE "Streak" ADD COLUMN "type" "StreakType" NOT NULL DEFAULT 'COWBOY_HAT';
-- AlterTable
ALTER TABLE "users" ADD COLUMN "gunStreak" INTEGER,
ADD COLUMN "horseStreak" INTEGER;
-- CreateIndex
CREATE INDEX "Streak_type_idx" ON "Streak"("type");
-- CreateIndex
CREATE INDEX "users_streak_idx" ON "users"("streak");
-- CreateIndex
CREATE INDEX "users_gunStreak_idx" ON "users"("gunStreak");
-- CreateIndex
CREATE INDEX "users_horseStreak_idx" ON "users"("horseStreak");
-- DropIndex
DROP INDEX "Streak.startedAt_userId_unique";
-- CreateIndex
CREATE UNIQUE INDEX "Streak_startedAt_userId_type_key" ON "Streak"("startedAt", "userId", "type");