Skip to content

Commit d514c3c

Browse files
authored
chore: sync upstream cella v0.10.2 (55af2fac) (#139)
1 parent 22e895a commit d514c3c

138 files changed

Lines changed: 24512 additions & 3133 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/.env.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ TRANSLOADIT_KEY=your_transloadit_key
101101
TRANSLOADIT_SECRET=your_transloadit_secret
102102

103103
# S3 on Scaleway (for file uploads and signed URLs). Optional: empty disables direct-S3
104-
# presigning. In production this is a scoped Object-Storage key the infra CLI can mint
105-
# (managed key `s3`) or you set it by hand via "Manage runtime secrets".
104+
# presigning. Seeded attachments live in the shared public development bucket and render
105+
# without these keys; they are needed to presign your own private uploads. In production this
106+
# is a scoped Object-Storage key the infra CLI can mint (managed key `s3`) or you set it by
107+
# hand via "Manage runtime secrets".
106108
S3_ACCESS_KEY_ID=
107109
S3_ACCESS_KEY_SECRET=
108110

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CREATE TABLE "yjs_updates" (
2+
"id" bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "yjs_updates_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1),
3+
"entity_type" varchar(50) NOT NULL,
4+
"entity_id" uuid NOT NULL,
5+
"tenant_id" varchar(24) NOT NULL,
6+
"organization_id" uuid,
7+
"user_id" uuid,
8+
"payload" bytea NOT NULL,
9+
"created_at" timestamp DEFAULT now() NOT NULL
10+
);
11+
--> statement-breakpoint
12+
ALTER TABLE "yjs_updates" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
13+
ALTER TABLE "yjs_documents" DROP COLUMN "last_edited_by";--> statement-breakpoint
14+
CREATE INDEX "idx_yjs_updates_doc" ON "yjs_updates" ("entity_type","entity_id","id");--> statement-breakpoint
15+
CREATE INDEX "idx_yjs_updates_tenant" ON "yjs_updates" ("tenant_id");--> statement-breakpoint
16+
ALTER TABLE "yjs_updates" ADD CONSTRAINT "yjs_updates_tenant_id_tenants_id_fkey" FOREIGN KEY ("tenant_id") REFERENCES "tenants"("id");--> statement-breakpoint
17+
ALTER TABLE "yjs_updates" ADD CONSTRAINT "yjs_updates_Yt7qMI3dLu4u_fkey" FOREIGN KEY ("tenant_id","organization_id") REFERENCES "organizations"("tenant_id","id") ON DELETE CASCADE;--> statement-breakpoint
18+
CREATE POLICY "yjs_updates_select_policy" ON "yjs_updates" AS PERMISSIVE FOR SELECT TO public USING (
19+
20+
COALESCE(current_setting('app.tenant_id', true), '') != ''
21+
AND "yjs_updates"."tenant_id" = current_setting('app.tenant_id', true)::text
22+
23+
24+
);--> statement-breakpoint
25+
CREATE POLICY "yjs_updates_insert_policy" ON "yjs_updates" AS PERMISSIVE FOR INSERT TO public WITH CHECK (true);--> statement-breakpoint
26+
CREATE POLICY "yjs_updates_update_policy" ON "yjs_updates" AS PERMISSIVE FOR UPDATE TO public USING (true);--> statement-breakpoint
27+
CREATE POLICY "yjs_updates_delete_policy" ON "yjs_updates" AS PERMISSIVE FOR DELETE TO public USING (true);

0 commit comments

Comments
 (0)