more package declarations

This commit is contained in:
2026-05-17 21:52:38 -04:00
parent a8a5930ced
commit f118d3a4f3
44 changed files with 14019 additions and 1918 deletions

View File

@@ -0,0 +1,36 @@
-- Create device types enum
DO $$ BEGIN
CREATE TYPE "DeviceType" AS ENUM('mobile', 'web', 'desktop');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
-- Create platform enum
DO $$ BEGIN
CREATE TYPE "Platform" AS ENUM('ios', 'android', 'web');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
-- Create device_tokens table
CREATE TABLE IF NOT EXISTS "device_tokens" (
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
"userId" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
"deviceType" "DeviceType" NOT NULL DEFAULT 'mobile',
"token" TEXT NOT NULL UNIQUE,
"platform" "Platform" NOT NULL,
"appName" TEXT,
"appVersion" TEXT,
"osVersion" TEXT,
"model" TEXT,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"lastUsedAt" TIMESTAMP NOT NULL DEFAULT NOW(),
"createdAt" TIMESTAMP NOT NULL DEFAULT NOW(),
"updatedAt" TIMESTAMP NOT NULL DEFAULT NOW()
);
-- Create indexes
CREATE INDEX IF NOT EXISTS "device_tokens_userId_idx" ON "device_tokens"("userId");
CREATE INDEX IF NOT EXISTS "device_tokens_deviceType_idx" ON "device_tokens"("deviceType");
CREATE INDEX IF NOT EXISTS "device_tokens_platform_idx" ON "device_tokens"("platform");
CREATE INDEX IF NOT EXISTS "device_tokens_isActive_idx" ON "device_tokens"("isActive");

View File

@@ -2,7 +2,9 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
"rootDir": "./src",
"module": "ES2022",
"moduleResolution": "Bundler"
},
"include": ["src/**/*.ts"]
}