feat: setup and roles
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE "sessions" ADD COLUMN "impersonated_by" text;--> statement-breakpoint
|
||||
ALTER TABLE "users" ADD COLUMN "role" text DEFAULT 'user';--> statement-breakpoint
|
||||
ALTER TABLE "users" ADD COLUMN "banned" boolean DEFAULT false;--> statement-breakpoint
|
||||
ALTER TABLE "users" ADD COLUMN "ban_reason" text;--> statement-breakpoint
|
||||
ALTER TABLE "users" ADD COLUMN "ban_expires" timestamp with time zone;--> statement-breakpoint
|
||||
-- Accounts were all equal until now, so the oldest one becomes the admin.
|
||||
UPDATE "users" SET "role" = 'admin' WHERE "id" = (SELECT "id" FROM "users" ORDER BY "created_at", "id" LIMIT 1);
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user