AFFiNE/apps/server/migrations/20230906100042_user_feature_gates/migration.sql
DarkSky f4340da478
refactor(server): rate limit and permission (#4198)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2023-09-07 14:32:41 -07:00

14 lines
491 B
SQL

-- CreateTable
CREATE TABLE "user_feature_gates" (
"id" VARCHAR NOT NULL,
"user_id" VARCHAR NOT NULL,
"feature" VARCHAR NOT NULL,
"reason" VARCHAR NOT NULL,
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "user_feature_gates_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "user_feature_gates" ADD CONSTRAINT "user_feature_gates_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;