-- CreateTable
CREATE TABLE IF NOT EXISTS "DeviceToken" (
    "id"         TEXT NOT NULL,
    "ownerId"    TEXT NOT NULL,
    "adminId"    TEXT,
    "approverId" TEXT,
    "platform"   TEXT NOT NULL,
    "token"      TEXT NOT NULL,
    "createdAt"  TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt"  TIMESTAMP(3) NOT NULL,

    CONSTRAINT "DeviceToken_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX IF NOT EXISTS "DeviceToken_token_key" ON "DeviceToken"("token");
CREATE INDEX IF NOT EXISTS "DeviceToken_ownerId_idx"    ON "DeviceToken"("ownerId");
CREATE INDEX IF NOT EXISTS "DeviceToken_adminId_idx"    ON "DeviceToken"("adminId");
CREATE INDEX IF NOT EXISTS "DeviceToken_approverId_idx" ON "DeviceToken"("approverId");
