@hogsend/db 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "contacts" ADD COLUMN "discord_id" text;--> statement-breakpoint
2
+ CREATE UNIQUE INDEX "contacts_discord_id_unique_idx" ON "contacts" USING btree ("discord_id") WHERE discord_id IS NOT NULL AND deleted_at IS NULL;
@@ -0,0 +1,15 @@
1
+ CREATE TABLE "connector_link_codes" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "connector_id" text NOT NULL,
4
+ "code_hash" text NOT NULL,
5
+ "platform_user_id" text NOT NULL,
6
+ "target_email" text NOT NULL,
7
+ "expires_at" timestamp with time zone NOT NULL,
8
+ "used_at" timestamp with time zone,
9
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
10
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
11
+ );
12
+ --> statement-breakpoint
13
+ CREATE UNIQUE INDEX "connector_link_codes_code_hash_idx" ON "connector_link_codes" USING btree ("code_hash");--> statement-breakpoint
14
+ CREATE INDEX "connector_link_codes_throttle_user_idx" ON "connector_link_codes" USING btree ("connector_id","platform_user_id","created_at");--> statement-breakpoint
15
+ CREATE INDEX "connector_link_codes_throttle_email_idx" ON "connector_link_codes" USING btree ("connector_id","target_email","created_at");