@shipfox/api-workspaces 2.0.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.
- package/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +97 -0
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -0
- package/dist/core/entities/index.d.ts +4 -0
- package/dist/core/entities/index.d.ts.map +1 -0
- package/dist/core/entities/index.js +3 -0
- package/dist/core/entities/index.js.map +1 -0
- package/dist/core/entities/invitation.d.ts +14 -0
- package/dist/core/entities/invitation.d.ts.map +1 -0
- package/dist/core/entities/invitation.js +3 -0
- package/dist/core/entities/invitation.js.map +1 -0
- package/dist/core/entities/membership.d.ts +10 -0
- package/dist/core/entities/membership.d.ts.map +1 -0
- package/dist/core/entities/membership.js +3 -0
- package/dist/core/entities/membership.js.map +1 -0
- package/dist/core/entities/workspace.d.ts +10 -0
- package/dist/core/entities/workspace.d.ts.map +1 -0
- package/dist/core/entities/workspace.js +3 -0
- package/dist/core/entities/workspace.js.map +1 -0
- package/dist/core/errors.d.ts +52 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +104 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/invitations.d.ts +51 -0
- package/dist/core/invitations.d.ts.map +1 -0
- package/dist/core/invitations.js +136 -0
- package/dist/core/invitations.js.map +1 -0
- package/dist/core/memberships.d.ts +9 -0
- package/dist/core/memberships.d.ts.map +1 -0
- package/dist/core/memberships.js +13 -0
- package/dist/core/memberships.js.map +1 -0
- package/dist/core/workspaces.d.ts +40 -0
- package/dist/core/workspaces.d.ts.map +1 -0
- package/dist/core/workspaces.js +85 -0
- package/dist/core/workspaces.js.map +1 -0
- package/dist/db/db.d.ts +1253 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +24 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/index.d.ts +10 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +10 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/invitations.d.ts +47 -0
- package/dist/db/invitations.d.ts.map +1 -0
- package/dist/db/invitations.js +107 -0
- package/dist/db/invitations.js.map +1 -0
- package/dist/db/memberships.d.ts +44 -0
- package/dist/db/memberships.d.ts.map +1 -0
- package/dist/db/memberships.js +75 -0
- package/dist/db/memberships.js.map +1 -0
- package/dist/db/schema/common.d.ts +2 -0
- package/dist/db/schema/common.d.ts.map +1 -0
- package/dist/db/schema/common.js +4 -0
- package/dist/db/schema/common.js.map +1 -0
- package/dist/db/schema/invitations.d.ts +199 -0
- package/dist/db/schema/invitations.d.ts.map +1 -0
- package/dist/db/schema/invitations.js +47 -0
- package/dist/db/schema/invitations.js.map +1 -0
- package/dist/db/schema/memberships.d.ts +131 -0
- package/dist/db/schema/memberships.d.ts.map +1 -0
- package/dist/db/schema/memberships.js +35 -0
- package/dist/db/schema/memberships.js.map +1 -0
- package/dist/db/schema/outbox.d.ts +195 -0
- package/dist/db/schema/outbox.d.ts.map +1 -0
- package/dist/db/schema/outbox.js +5 -0
- package/dist/db/schema/outbox.js.map +1 -0
- package/dist/db/schema/workspaces.d.ts +115 -0
- package/dist/db/schema/workspaces.d.ts.map +1 -0
- package/dist/db/schema/workspaces.js +32 -0
- package/dist/db/schema/workspaces.js.map +1 -0
- package/dist/db/workspaces.d.ts +20 -0
- package/dist/db/workspaces.d.ts.map +1 -0
- package/dist/db/workspaces.js +53 -0
- package/dist/db/workspaces.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +3 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/instance.d.ts +8 -0
- package/dist/metrics/instance.d.ts.map +1 -0
- package/dist/metrics/instance.js +41 -0
- package/dist/metrics/instance.js.map +1 -0
- package/dist/metrics/service.d.ts +2 -0
- package/dist/metrics/service.d.ts.map +1 -0
- package/dist/metrics/service.js +26 -0
- package/dist/metrics/service.js.map +1 -0
- package/dist/presentation/dto/index.d.ts +4 -0
- package/dist/presentation/dto/index.d.ts.map +1 -0
- package/dist/presentation/dto/index.js +5 -0
- package/dist/presentation/dto/index.js.map +1 -0
- package/dist/presentation/dto/invitation.d.ts +4 -0
- package/dist/presentation/dto/invitation.d.ts.map +1 -0
- package/dist/presentation/dto/invitation.js +15 -0
- package/dist/presentation/dto/invitation.js.map +1 -0
- package/dist/presentation/dto/membership.d.ts +5 -0
- package/dist/presentation/dto/membership.d.ts.map +1 -0
- package/dist/presentation/dto/membership.js +23 -0
- package/dist/presentation/dto/membership.js.map +1 -0
- package/dist/presentation/dto/workspace.d.ts +4 -0
- package/dist/presentation/dto/workspace.d.ts.map +1 -0
- package/dist/presentation/dto/workspace.js +12 -0
- package/dist/presentation/dto/workspace.js.map +1 -0
- package/dist/presentation/e2eRoutes/create-invitation.d.ts +2 -0
- package/dist/presentation/e2eRoutes/create-invitation.d.ts.map +1 -0
- package/dist/presentation/e2eRoutes/create-invitation.js +39 -0
- package/dist/presentation/e2eRoutes/create-invitation.js.map +1 -0
- package/dist/presentation/e2eRoutes/create-workspace.d.ts +2 -0
- package/dist/presentation/e2eRoutes/create-workspace.d.ts.map +1 -0
- package/dist/presentation/e2eRoutes/create-workspace.js +27 -0
- package/dist/presentation/e2eRoutes/create-workspace.js.map +1 -0
- package/dist/presentation/e2eRoutes/index.d.ts +3 -0
- package/dist/presentation/e2eRoutes/index.d.ts.map +1 -0
- package/dist/presentation/e2eRoutes/index.js +11 -0
- package/dist/presentation/e2eRoutes/index.js.map +1 -0
- package/dist/presentation/index.d.ts +2 -0
- package/dist/presentation/index.d.ts.map +1 -0
- package/dist/presentation/index.js +3 -0
- package/dist/presentation/index.js.map +1 -0
- package/dist/presentation/routes/index.d.ts +3 -0
- package/dist/presentation/routes/index.d.ts.map +1 -0
- package/dist/presentation/routes/index.js +23 -0
- package/dist/presentation/routes/index.js.map +1 -0
- package/dist/presentation/routes/invitations/accept.d.ts +2 -0
- package/dist/presentation/routes/invitations/accept.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/accept.js +67 -0
- package/dist/presentation/routes/invitations/accept.js.map +1 -0
- package/dist/presentation/routes/invitations/create.d.ts +2 -0
- package/dist/presentation/routes/invitations/create.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/create.js +66 -0
- package/dist/presentation/routes/invitations/create.js.map +1 -0
- package/dist/presentation/routes/invitations/index.d.ts +4 -0
- package/dist/presentation/routes/invitations/index.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/index.js +19 -0
- package/dist/presentation/routes/invitations/index.js.map +1 -0
- package/dist/presentation/routes/invitations/list.d.ts +2 -0
- package/dist/presentation/routes/invitations/list.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/list.js +58 -0
- package/dist/presentation/routes/invitations/list.js.map +1 -0
- package/dist/presentation/routes/invitations/preview.d.ts +2 -0
- package/dist/presentation/routes/invitations/preview.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/preview.js +47 -0
- package/dist/presentation/routes/invitations/preview.js.map +1 -0
- package/dist/presentation/routes/invitations/revoke.d.ts +2 -0
- package/dist/presentation/routes/invitations/revoke.d.ts.map +1 -0
- package/dist/presentation/routes/invitations/revoke.js +66 -0
- package/dist/presentation/routes/invitations/revoke.js.map +1 -0
- package/dist/presentation/routes/members/index.d.ts +3 -0
- package/dist/presentation/routes/members/index.d.ts.map +1 -0
- package/dist/presentation/routes/members/index.js +8 -0
- package/dist/presentation/routes/members/index.js.map +1 -0
- package/dist/presentation/routes/members/list.d.ts +2 -0
- package/dist/presentation/routes/members/list.d.ts.map +1 -0
- package/dist/presentation/routes/members/list.js +58 -0
- package/dist/presentation/routes/members/list.js.map +1 -0
- package/dist/presentation/routes/members/remove.d.ts +2 -0
- package/dist/presentation/routes/members/remove.d.ts.map +1 -0
- package/dist/presentation/routes/members/remove.js +71 -0
- package/dist/presentation/routes/members/remove.js.map +1 -0
- package/dist/presentation/routes/workspaces/create.d.ts +2 -0
- package/dist/presentation/routes/workspaces/create.d.ts.map +1 -0
- package/dist/presentation/routes/workspaces/create.js +36 -0
- package/dist/presentation/routes/workspaces/create.js.map +1 -0
- package/dist/presentation/routes/workspaces/index.d.ts +3 -0
- package/dist/presentation/routes/workspaces/index.d.ts.map +1 -0
- package/dist/presentation/routes/workspaces/index.js +4 -0
- package/dist/presentation/routes/workspaces/index.js.map +1 -0
- package/dist/presentation/routes/workspaces/list.d.ts +2 -0
- package/dist/presentation/routes/workspaces/list.d.ts.map +1 -0
- package/dist/presentation/routes/workspaces/list.js +32 -0
- package/dist/presentation/routes/workspaces/list.js.map +1 -0
- package/dist/presentation/subscribers/index.d.ts +2 -0
- package/dist/presentation/subscribers/index.d.ts.map +1 -0
- package/dist/presentation/subscribers/index.js +3 -0
- package/dist/presentation/subscribers/index.js.map +1 -0
- package/dist/presentation/subscribers/on-invitation-send-requested.d.ts +3 -0
- package/dist/presentation/subscribers/on-invitation-send-requested.d.ts.map +1 -0
- package/dist/presentation/subscribers/on-invitation-send-requested.js +16 -0
- package/dist/presentation/subscribers/on-invitation-send-requested.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/drizzle/0000_initial.sql +9 -0
- package/drizzle/0001_memberships_invitations.sql +30 -0
- package/drizzle/0002_membership_user_snapshots.sql +40 -0
- package/drizzle/0003_outgoing_enchantress.sql +16 -0
- package/drizzle/meta/0000_snapshot.json +80 -0
- package/drizzle/meta/0001_snapshot.json +705 -0
- package/drizzle/meta/0003_snapshot.json +442 -0
- package/drizzle/meta/_journal.json +34 -0
- package/drizzle.config.ts +7 -0
- package/package.json +71 -0
- package/src/config.ts +51 -0
- package/src/core/entities/index.ts +3 -0
- package/src/core/entities/invitation.ts +13 -0
- package/src/core/entities/membership.ts +9 -0
- package/src/core/entities/workspace.ts +10 -0
- package/src/core/errors.ts +118 -0
- package/src/core/index.ts +35 -0
- package/src/core/invitations.test.ts +251 -0
- package/src/core/invitations.ts +191 -0
- package/src/core/memberships.test.ts +77 -0
- package/src/core/memberships.ts +17 -0
- package/src/core/workspaces.test.ts +72 -0
- package/src/core/workspaces.ts +126 -0
- package/src/db/db.ts +24 -0
- package/src/db/index.ts +43 -0
- package/src/db/invitations.test.ts +204 -0
- package/src/db/invitations.ts +235 -0
- package/src/db/memberships.test.ts +107 -0
- package/src/db/memberships.ts +139 -0
- package/src/db/schema/common.ts +5 -0
- package/src/db/schema/invitations.ts +47 -0
- package/src/db/schema/memberships.ts +39 -0
- package/src/db/schema/outbox.ts +4 -0
- package/src/db/schema/workspaces.ts +33 -0
- package/src/db/workspaces.test.ts +114 -0
- package/src/db/workspaces.ts +81 -0
- package/src/index.test.ts +25 -0
- package/src/index.ts +43 -0
- package/src/metrics/index.ts +1 -0
- package/src/metrics/instance.test.ts +74 -0
- package/src/metrics/instance.ts +57 -0
- package/src/metrics/service.ts +26 -0
- package/src/presentation/dto/index.ts +3 -0
- package/src/presentation/dto/invitation.ts +16 -0
- package/src/presentation/dto/membership.ts +27 -0
- package/src/presentation/dto/workspace.ts +13 -0
- package/src/presentation/e2eRoutes/create-invitation.ts +44 -0
- package/src/presentation/e2eRoutes/create-workspace.ts +30 -0
- package/src/presentation/e2eRoutes/index.ts +8 -0
- package/src/presentation/index.ts +1 -0
- package/src/presentation/routes/index.ts +23 -0
- package/src/presentation/routes/invitations/accept.test.ts +154 -0
- package/src/presentation/routes/invitations/accept.ts +70 -0
- package/src/presentation/routes/invitations/create.test.ts +99 -0
- package/src/presentation/routes/invitations/create.ts +60 -0
- package/src/presentation/routes/invitations/index.ts +17 -0
- package/src/presentation/routes/invitations/list.test.ts +94 -0
- package/src/presentation/routes/invitations/list.ts +53 -0
- package/src/presentation/routes/invitations/preview.test.ts +140 -0
- package/src/presentation/routes/invitations/preview.ts +46 -0
- package/src/presentation/routes/invitations/revoke.test.ts +99 -0
- package/src/presentation/routes/invitations/revoke.ts +64 -0
- package/src/presentation/routes/members/index.ts +5 -0
- package/src/presentation/routes/members/list.test.ts +95 -0
- package/src/presentation/routes/members/list.ts +53 -0
- package/src/presentation/routes/members/remove.test.ts +110 -0
- package/src/presentation/routes/members/remove.ts +66 -0
- package/src/presentation/routes/workspaces/create.test.ts +87 -0
- package/src/presentation/routes/workspaces/create.ts +36 -0
- package/src/presentation/routes/workspaces/index.ts +2 -0
- package/src/presentation/routes/workspaces/list.test.ts +56 -0
- package/src/presentation/routes/workspaces/list.ts +29 -0
- package/src/presentation/subscribers/index.ts +1 -0
- package/src/presentation/subscribers/invitation-send-requested.test.ts +64 -0
- package/src/presentation/subscribers/on-invitation-send-requested.ts +15 -0
- package/test/env.ts +8 -0
- package/test/factories/index.ts +3 -0
- package/test/factories/membership.ts +24 -0
- package/test/factories/user.ts +15 -0
- package/test/factories/workspace.ts +18 -0
- package/test/globalSetup.ts +15 -0
- package/test/index.ts +3 -0
- package/test/routes.ts +255 -0
- package/test/setup.ts +17 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TYPE "public"."workspaces_workspace_status" AS ENUM('active', 'suspended', 'deleted');--> statement-breakpoint
|
|
2
|
+
CREATE TABLE "workspaces" (
|
|
3
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
4
|
+
"name" text NOT NULL,
|
|
5
|
+
"status" "workspaces_workspace_status" DEFAULT 'active' NOT NULL,
|
|
6
|
+
"settings" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
7
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
8
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
9
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
CREATE TABLE "workspaces_invitations" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
3
|
+
"workspace_id" uuid NOT NULL,
|
|
4
|
+
"email" text NOT NULL,
|
|
5
|
+
"hashed_token" text NOT NULL,
|
|
6
|
+
"expires_at" timestamp with time zone NOT NULL,
|
|
7
|
+
"accepted_at" timestamp with time zone,
|
|
8
|
+
"accepted_by_user_id" uuid,
|
|
9
|
+
"invited_by_user_id" uuid NOT NULL,
|
|
10
|
+
"invited_by_display" text,
|
|
11
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
12
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
CREATE TABLE "workspaces_memberships" (
|
|
16
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
17
|
+
"user_id" uuid NOT NULL,
|
|
18
|
+
"user_email" text NOT NULL,
|
|
19
|
+
"user_name" text,
|
|
20
|
+
"workspace_id" uuid NOT NULL,
|
|
21
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
22
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
23
|
+
);
|
|
24
|
+
--> statement-breakpoint
|
|
25
|
+
ALTER TABLE "workspaces_invitations" ADD CONSTRAINT "workspaces_invitations_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
26
|
+
ALTER TABLE "workspaces_memberships" ADD CONSTRAINT "workspaces_memberships_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
27
|
+
CREATE UNIQUE INDEX "workspaces_invitations_hashed_token_unique" ON "workspaces_invitations" USING btree ("hashed_token");--> statement-breakpoint
|
|
28
|
+
CREATE INDEX "workspaces_invitations_workspace_email_idx" ON "workspaces_invitations" USING btree ("workspace_id","email");--> statement-breakpoint
|
|
29
|
+
CREATE UNIQUE INDEX "workspaces_memberships_user_workspace_unique" ON "workspaces_memberships" USING btree ("user_id","workspace_id");--> statement-breakpoint
|
|
30
|
+
CREATE INDEX "workspaces_memberships_workspace_id_idx" ON "workspaces_memberships" USING btree ("workspace_id");
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
ALTER TABLE "workspaces_memberships" ADD COLUMN IF NOT EXISTS "user_email" text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "workspaces_memberships" ADD COLUMN IF NOT EXISTS "user_name" text;--> statement-breakpoint
|
|
3
|
+
DO $$
|
|
4
|
+
BEGIN
|
|
5
|
+
IF to_regclass('public.workspaces_users') IS NOT NULL THEN
|
|
6
|
+
UPDATE "workspaces_memberships" memberships
|
|
7
|
+
SET
|
|
8
|
+
"user_email" = users."email",
|
|
9
|
+
"user_name" = users."name"
|
|
10
|
+
FROM "workspaces_users" users
|
|
11
|
+
WHERE memberships."user_id" = users."id"
|
|
12
|
+
AND memberships."user_email" IS NULL;
|
|
13
|
+
END IF;
|
|
14
|
+
END $$;--> statement-breakpoint
|
|
15
|
+
UPDATE "workspaces_memberships"
|
|
16
|
+
SET "user_email" = 'user-' || "user_id"::text || '@example.local'
|
|
17
|
+
WHERE "user_email" IS NULL;--> statement-breakpoint
|
|
18
|
+
ALTER TABLE "workspaces_memberships" ALTER COLUMN "user_email" SET NOT NULL;--> statement-breakpoint
|
|
19
|
+
DO $$
|
|
20
|
+
DECLARE
|
|
21
|
+
constraint_name text;
|
|
22
|
+
table_name text;
|
|
23
|
+
BEGIN
|
|
24
|
+
FOR constraint_name, table_name IN
|
|
25
|
+
SELECT tc.constraint_name, tc.table_name
|
|
26
|
+
FROM information_schema.table_constraints tc
|
|
27
|
+
JOIN information_schema.key_column_usage kcu
|
|
28
|
+
ON tc.constraint_name = kcu.constraint_name
|
|
29
|
+
AND tc.table_schema = kcu.table_schema
|
|
30
|
+
JOIN information_schema.constraint_column_usage ccu
|
|
31
|
+
ON ccu.constraint_name = tc.constraint_name
|
|
32
|
+
AND ccu.table_schema = tc.table_schema
|
|
33
|
+
WHERE tc.constraint_type = 'FOREIGN KEY'
|
|
34
|
+
AND tc.table_schema = 'public'
|
|
35
|
+
AND tc.table_name IN ('workspaces_memberships', 'workspaces_invitations')
|
|
36
|
+
AND ccu.table_name = 'workspaces_users'
|
|
37
|
+
LOOP
|
|
38
|
+
EXECUTE format('ALTER TABLE %I DROP CONSTRAINT %I', table_name, constraint_name);
|
|
39
|
+
END LOOP;
|
|
40
|
+
END $$;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
CREATE TABLE "workspaces_outbox" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT uuidv7() NOT NULL,
|
|
3
|
+
"event_type" text NOT NULL,
|
|
4
|
+
"ordering_key" text,
|
|
5
|
+
"payload" jsonb NOT NULL,
|
|
6
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
7
|
+
"dispatched_at" timestamp with time zone,
|
|
8
|
+
"dispatch_attempts" integer DEFAULT 0 NOT NULL,
|
|
9
|
+
"next_dispatch_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
10
|
+
"last_dispatch_error" jsonb,
|
|
11
|
+
"last_dispatch_failed_at" timestamp with time zone,
|
|
12
|
+
"dead_lettered_at" timestamp with time zone
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
CREATE INDEX "workspaces_outbox_pending_idx" ON "workspaces_outbox" USING btree ("next_dispatch_at","created_at") WHERE "dispatched_at" IS NULL AND "dead_lettered_at" IS NULL;--> statement-breakpoint
|
|
16
|
+
CREATE INDEX "workspaces_outbox_dispatched_retention_idx" ON "workspaces_outbox" USING btree ("dispatched_at","id") WHERE "dispatched_at" IS NOT NULL;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "0d727c74-5924-496b-94b6-df0c8943fcc4",
|
|
3
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"public.workspaces": {
|
|
8
|
+
"name": "workspaces",
|
|
9
|
+
"schema": "",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "uuid",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true,
|
|
16
|
+
"default": "uuidv7()"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"name": "name",
|
|
20
|
+
"type": "text",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"status": {
|
|
25
|
+
"name": "status",
|
|
26
|
+
"type": "workspaces_workspace_status",
|
|
27
|
+
"typeSchema": "public",
|
|
28
|
+
"primaryKey": false,
|
|
29
|
+
"notNull": true,
|
|
30
|
+
"default": "'active'"
|
|
31
|
+
},
|
|
32
|
+
"settings": {
|
|
33
|
+
"name": "settings",
|
|
34
|
+
"type": "jsonb",
|
|
35
|
+
"primaryKey": false,
|
|
36
|
+
"notNull": true,
|
|
37
|
+
"default": "'{}'::jsonb"
|
|
38
|
+
},
|
|
39
|
+
"created_at": {
|
|
40
|
+
"name": "created_at",
|
|
41
|
+
"type": "timestamp with time zone",
|
|
42
|
+
"primaryKey": false,
|
|
43
|
+
"notNull": true,
|
|
44
|
+
"default": "now()"
|
|
45
|
+
},
|
|
46
|
+
"updated_at": {
|
|
47
|
+
"name": "updated_at",
|
|
48
|
+
"type": "timestamp with time zone",
|
|
49
|
+
"primaryKey": false,
|
|
50
|
+
"notNull": true,
|
|
51
|
+
"default": "now()"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"indexes": {},
|
|
55
|
+
"foreignKeys": {},
|
|
56
|
+
"compositePrimaryKeys": {},
|
|
57
|
+
"uniqueConstraints": {},
|
|
58
|
+
"policies": {},
|
|
59
|
+
"checkConstraints": {},
|
|
60
|
+
"isRLSEnabled": false
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"enums": {
|
|
64
|
+
"public.workspaces_workspace_status": {
|
|
65
|
+
"name": "workspaces_workspace_status",
|
|
66
|
+
"schema": "public",
|
|
67
|
+
"values": ["active", "suspended", "deleted"]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"schemas": {},
|
|
71
|
+
"sequences": {},
|
|
72
|
+
"roles": {},
|
|
73
|
+
"policies": {},
|
|
74
|
+
"views": {},
|
|
75
|
+
"_meta": {
|
|
76
|
+
"columns": {},
|
|
77
|
+
"schemas": {},
|
|
78
|
+
"tables": {}
|
|
79
|
+
}
|
|
80
|
+
}
|