CREATE TABLE "refresh_tokens" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "user_id" uuid NOT NULL, "token_hash" text NOT NULL, "access_jti" text NOT NULL, "expires_at" bigint NOT NULL, "revoked_at" bigint, "replaced_by" uuid, "created_at" bigint NOT NULL ); --> statement-breakpoint CREATE TABLE "revoked_access_tokens" ( "jti" text PRIMARY KEY NOT NULL, "expires_at" bigint NOT NULL ); --> statement-breakpoint CREATE TABLE "users" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "username" text NOT NULL, "password_hash" text NOT NULL, "created_at" bigint NOT NULL, "updated_at" bigint NOT NULL ); --> statement-breakpoint ALTER TABLE "refresh_tokens" ADD CONSTRAINT "refresh_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint CREATE UNIQUE INDEX "refresh_tokens_token_hash_unique" ON "refresh_tokens" USING btree ("token_hash");--> statement-breakpoint CREATE UNIQUE INDEX "users_username_unique" ON "users" USING btree ("username");