Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a38a2bf
feat: add password login and admin credentials management
LSalami Oct 28, 2026
d831b75
feat: add locale preference and i18n foundation
LSalami Oct 28, 2026
74a5b6b
feat: translate settings and account navigation
LSalami Oct 28, 2026
e5c756b
feat: translate inbox sidebar navigation
LSalami Oct 28, 2026
63e79d5
feat: translate conversation composer actions
LSalami Oct 28, 2026
c6414a6
feat: translate conversation and message actions
LSalami Oct 28, 2026
3b91e9c
feat: complete login page translations
LSalami Oct 28, 2026
4e93ed1
fix: localize server-rendered login copy
LSalami Oct 28, 2026
d4f8799
feat: translate personal preferences
LSalami Oct 28, 2026
68d7f3c
feat: translate login signal panel
LSalami Oct 28, 2026
cdac328
fix: update login authentication footer copy
LSalami Oct 28, 2026
dabe167
feat: translate remaining inbox surfaces
LSalami Oct 28, 2026
fd5e746
feat: translate onboarding wizard
LSalami Oct 28, 2026
d2899e8
feat: translate notification preferences
LSalami Oct 28, 2026
24178e9
feat: translate localized input examples
LSalami Oct 28, 2026
a551c41
feat: translate inbox input suggestions
LSalami Oct 28, 2026
f5890ea
feat: translate contact and admin input examples
LSalami Oct 28, 2026
efe7b00
feat: translate signature settings
LSalami Oct 28, 2026
98725a3
feat: add password visibility toggle
LSalami Oct 28, 2026
8a85f3e
feat: localize common user-facing errors
LSalami Oct 28, 2026
97e8b7c
feat: add pre-login language selector
LSalami Oct 28, 2026
31c43f2
feat: translate analytics filters
LSalami Oct 28, 2026
93a891c
feat: translate analytics charts
LSalami Oct 28, 2026
d9bee82
feat: translate contacts interface
LSalami Oct 28, 2026
0fe6583
feat: translate task controls
LSalami Oct 28, 2026
718fc3a
feat: translate integrations and labels settings
LSalami Oct 28, 2026
e9f5ae6
fix: remove duplicate translation keys
LSalami Oct 28, 2026
134d2eb
feat: translate shared admin controls
LSalami Oct 28, 2026
ef1414b
feat: translate responses and roles settings
LSalami Oct 28, 2026
8d8e18b
feat: show invitation links in admin result
LSalami Oct 28, 2026
7664751
feat: translate member invitation flow
LSalami Oct 28, 2026
604d99c
fix: reuse invitation skipped translation
LSalami Oct 28, 2026
a8feec8
feat: set password while accepting invitation
LSalami Oct 28, 2026
626e59a
feat: translate email delivery settings
LSalami Oct 28, 2026
70f40a7
i18n: translate authentication and security settings
LSalami Oct 28, 2026
33f0ac8
fix: add private sign-up warning translations
LSalami Oct 28, 2026
d719acd
i18n: translate general instance settings
LSalami Oct 28, 2026
d3e8ff7
fix: keep locale dictionaries aligned
LSalami Oct 28, 2026
a6196e7
fix: repair italian sign-in locale key
LSalami Oct 28, 2026
5f788f5
i18n: translate user confirmations and session controls
LSalami Oct 28, 2026
ff1d766
i18n: translate invitation and label dialogs
LSalami Oct 28, 2026
fb7e41e
i18n: translate invitation page and role labels
LSalami Oct 28, 2026
bbcfab3
fix: type localized invitation states
LSalami Oct 28, 2026
1751ca2
i18n: translate workspace members and invitation controls
LSalami Oct 28, 2026
e017b39
fix: repair member status translation JSX
LSalami Oct 28, 2026
01e0755
fix: use existing resend invitation translation
LSalami Oct 28, 2026
b1a8f73
i18n: translate inbox labels in area navigation
LSalami Oct 28, 2026
38bdcff
i18n: translate roles and permissions settings
LSalami Oct 28, 2026
099f259
i18n: format dates and relative times by locale
LSalami Oct 28, 2026
47a20c3
fix: allow invite password validation on submit
LSalami Oct 28, 2026
de61e27
i18n: complete Italian interface translations
LSalami Oct 29, 2026
4902be6
feat: customize sidebar navigation
LSalami Oct 29, 2026
f8aff16
feat: let workspace admins disable chat
LSalami Oct 29, 2026
8f5a626
feat: manage workspace navigation visibility
LSalami Oct 29, 2026
b0dc8d3
ui: clarify inbox view contents
LSalami Oct 29, 2026
a15fbaf
fix: mark client UI boundaries for i18n hooks
LSalami Oct 29, 2026
ae0a6c9
i18n: translate assigned inbox description
LSalami Oct 29, 2026
4ca16d7
ui: place subject label above input
LSalami Oct 29, 2026
2b51af1
ui: align subject and compact sender in composer
LSalami Oct 29, 2026
aac72ec
fix: prevent composer subject overlap
LSalami Oct 29, 2026
8db5ed3
ui: compact composer signature preview
LSalami Oct 29, 2026
2e3f2b3
fix: keep signature close to composer body
LSalami Oct 29, 2026
db82c5e
ui: reduce empty space before signature
LSalami Oct 29, 2026
6963dce
fix: keep signature preview consistent with email
LSalami Oct 29, 2026
a0288b0
ui: compact signature line breaks consistently
LSalami Oct 29, 2026
3c29e5c
ui: expand composer writing area
LSalami Oct 29, 2026
17b0653
ui: make composer body fill available space
LSalami Oct 29, 2026
4548584
fix: make full composer body editable
LSalami Oct 29, 2026
721a114
fix: expand composer editor wrapper
LSalami Oct 29, 2026
2e804d8
fix: prevent iOS input zoom on focus
LSalami Oct 29, 2026
52789e9
ui: tighten recipient row spacing
LSalami Oct 29, 2026
ffce845
ui: distinguish incoming and sent messages
LSalami Oct 29, 2026
b13a71a
Improve email search matching and results UX
LSalami Oct 29, 2026
9e42584
Add advanced email search filters
LSalami Nov 4, 2026
5ed589f
Restore inbox translations and mobile input sizing
LSalami Nov 5, 2026
7b35c9a
Keep dynamic inbox translations intact
LSalami Nov 5, 2026
4da3ec7
Translate search palette and expose advanced search
LSalami Nov 5, 2026
4f6dfb2
Translate inbox page titles and descriptions
LSalami Nov 5, 2026
bc1cec0
Translate remaining workspace interface labels
LSalami Nov 5, 2026
90d136c
Add Italian navigation label aliases
LSalami Nov 5, 2026
1208ae5
Localize page metadata and browser tab titles
LSalami Nov 5, 2026
6bc3905
Improve advanced search discoverability
LSalami Nov 5, 2026
c51d46d
Redesign search layout and use shared date picker
LSalami Nov 5, 2026
7ef3677
Keep search actions visible in the filter column
LSalami Nov 5, 2026
b88ff49
Make the search filter column resizable and group date and size fields
LSalami Nov 5, 2026
e3c3702
Use the shared Select for search filters and language switcher
LSalami Nov 5, 2026
09b7c43
Add workspace calendar and Aruba CalDAV sync
LSalami Nov 6, 2026
7496af6
IMAP completion: server folders, remote moves, draft sync, local copy…
LSalami Nov 6, 2026
a7fbe97
Fork: detach from codextde/dispatch upstream
LSalami Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Docker image

# Builds ghcr.io/codextde/dispatch for linux/amd64 and linux/arm64 on native
# Builds ghcr.io/lsalami/dispatch for linux/amd64 and linux/arm64 on native
# runners (no QEMU) with Docker's reusable github-builder workflow, which adds
# SLSA provenance, an SBOM and signed attestations.
#
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
output: image
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
meta-images: ghcr.io/codextde/dispatch
meta-images: ghcr.io/lsalami/dispatch
meta-tags: |
type=ref,event=branch
type=semver,pattern={{version}}
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:1
#
# Dispatch — one image, two roles:
# docker run ghcr.io/codextde/dispatch web app (Next.js standalone server on :3000)
# docker run ghcr.io/codextde/dispatch worker background worker (IMAP sync, sending, rules, webhooks)
# docker run ghcr.io/lsalami/dispatch web app (Next.js standalone server on :3000)
# docker run ghcr.io/lsalami/dispatch worker background worker (IMAP sync, sending, rules, webhooks)
# See docker-compose.yml for the full stack and docs/self-hosting.md for details.

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -41,11 +41,11 @@ FROM node:24-alpine AS runner

LABEL org.opencontainers.image.title="Dispatch" \
org.opencontainers.image.description="The open-source collaborative inbox for teams: shared Gmail, Outlook and IMAP inboxes with comments, assignments and automation." \
org.opencontainers.image.source="https://github.com/codextde/dispatch" \
org.opencontainers.image.url="https://github.com/codextde/dispatch" \
org.opencontainers.image.documentation="https://github.com/codextde/dispatch/tree/main/docs" \
org.opencontainers.image.source="https://github.com/LSalami/dispatch" \
org.opencontainers.image.url="https://github.com/LSalami/dispatch" \
org.opencontainers.image.documentation="https://github.com/LSalami/dispatch/tree/main/docs" \
org.opencontainers.image.licenses="AGPL-3.0-only" \
org.opencontainers.image.vendor="Codext GmbH"
org.opencontainers.image.vendor="LSalami"

# tini: proper PID 1 (signal forwarding, zombie reaping)
RUN apk add --no-cache tini \
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
Self-host for free or use Dispatch Cloud for $50/month.</p>

[![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/codextde/dispatch?style=flat&logo=github)](https://github.com/codextde/dispatch/stargazers)
[![Docker image](https://img.shields.io/badge/ghcr.io-codextde%2Fdispatch-2496ED?logo=docker&logoColor=white)](https://github.com/codextde/dispatch/pkgs/container/dispatch)
[![CI](https://github.com/codextde/dispatch/actions/workflows/ci.yml/badge.svg)](https://github.com/codextde/dispatch/actions/workflows/ci.yml)
[![GitHub stars](https://img.shields.io/github/stars/LSalami/dispatch?style=flat&logo=github)](https://github.com/LSalami/dispatch/stargazers)
[![Docker image](https://img.shields.io/badge/ghcr.io-lsalami%2Fdispatch-2496ED?logo=docker&logoColor=white)](https://github.com/LSalami/dispatch/pkgs/container/dispatch)
[![CI](https://github.com/LSalami/dispatch/actions/workflows/ci.yml/badge.svg)](https://github.com/LSalami/dispatch/actions/workflows/ci.yml)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![Deploy on Coolify](https://img.shields.io/badge/deploy%20on-Coolify-8C52FF.svg)](docs/coolify.md)

Expand Down Expand Up @@ -92,15 +92,15 @@ Self-host for free or use Dispatch Cloud for $50/month.</p>
On any server with Docker and a domain pointing to it:

```bash
curl -fsSLO https://raw.githubusercontent.com/codextde/dispatch/main/docker-compose.yml
curl -fsSLO https://raw.githubusercontent.com/LSalami/dispatch/main/docker-compose.yml
echo "DOMAIN=mail.example.com" > .env
docker compose up -d
```

This starts the app, worker and PostgreSQL. The compose file publishes no ports, so put your reverse proxy in front of `app:3000`. Or download the [override with a bundled Caddy](docker-compose.override.example.yml) for automatic HTTPS:

```bash
curl -fsSL https://raw.githubusercontent.com/codextde/dispatch/main/docker-compose.override.example.yml -o docker-compose.override.yml
curl -fsSL https://raw.githubusercontent.com/LSalami/dispatch/main/docker-compose.override.example.yml -o docker-compose.override.yml
docker compose up -d
```

Expand Down Expand Up @@ -169,15 +169,15 @@ The **app** serves the UI, API and realtime stream. The **worker** syncs mailbox
- [ ] Website live chat widget
- [ ] Importers for Missive and Front

Have an idea? [Start a discussion](https://github.com/codextde/dispatch/discussions) or upvote existing [feature requests](https://github.com/codextde/dispatch/issues?q=is%3Aissue+label%3Aenhancement).
Have an idea? [Start a discussion](https://github.com/LSalami/dispatch/discussions) or upvote existing [feature requests](https://github.com/LSalami/dispatch/issues?q=is%3Aissue+label%3Aenhancement).

## Contributing

Contributions are welcome: bug reports, docs, translations and code. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup and guidelines, and please follow our [Code of Conduct](CODE_OF_CONDUCT.md).

## Security

Please report vulnerabilities privately via [GitHub security advisories](https://github.com/codextde/dispatch/security/advisories/new), not in public issues. See [SECURITY.md](SECURITY.md).
Please report vulnerabilities privately via [GitHub security advisories](https://github.com/LSalami/dispatch/security/advisories/new), not in public issues. See [SECURITY.md](SECURITY.md).

## License

Expand All @@ -187,7 +187,7 @@ Dispatch is licensed under the [GNU Affero General Public License v3.0](LICENSE)
- **You can modify it.** If you let people use a modified version over a network, for example as a hosted service, you must offer them the source code of your modifications under the AGPL-3.0.
- **Running it as a service is allowed.** The same condition applies: changes you make must be published to your users under the AGPL.

Dispatch is built and maintained by [Codext GmbH](https://github.com/codextde), Germany. Dispatch Cloud is the hosted version run by the maintainers, and it funds development.
Dispatch is originally built by [Codext GmbH](https://github.com/codextde), Germany. This is an independent fork maintained in this repository (AGPL-3.0-only, see [LICENSE](LICENSE)).

## Acknowledgements

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

services:
app:
image: ghcr.io/codextde/dispatch:${DISPATCH_VERSION:-latest}
image: ghcr.io/lsalami/dispatch:${DISPATCH_VERSION:-latest}
restart: unless-stopped
environment:
# Public hostname, e.g. mail.example.com. On Coolify it falls back to the
Expand All @@ -39,7 +39,7 @@ services:
start_period: 60s

worker:
image: ghcr.io/codextde/dispatch:${DISPATCH_VERSION:-latest}
image: ghcr.io/lsalami/dispatch:${DISPATCH_VERSION:-latest}
command: worker
restart: unless-stopped
environment:
Expand Down
6 changes: 3 additions & 3 deletions docs/coolify.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Pick **one** of the two ways. Both use the same compose file.
The compose file stays in sync with the repository, and Coolify can redeploy when it changes.

1. In your project, click **+ New** and choose **Public Repository**.
2. Repository URL: `https://github.com/codextde/dispatch`, branch `main`.
2. Repository URL: `https://github.com/LSalami/dispatch`, branch `main`.
3. Build pack: **Docker Compose**. Base directory `/`, Docker Compose location `/docker-compose.yml`.
4. Click **Continue**. Coolify reads the compose file and shows the services `app`, `worker` and `db`.

Nothing is built on your server: the compose file uses the prebuilt image `ghcr.io/codextde/dispatch`, so Coolify only pulls it.
Nothing is built on your server: the compose file uses the prebuilt image `ghcr.io/lsalami/dispatch`, so Coolify only pulls it.

### Option B: paste the compose file

Expand Down Expand Up @@ -92,7 +92,7 @@ Deleting the resource with "delete volumes" deletes all data. Back up `dispatch-

Dispatch applies database migrations automatically when the new version starts.

- **Pinned version (recommended):** set `DISPATCH_VERSION` to the new release (see [releases](https://github.com/codextde/dispatch/releases)) and click **Redeploy**. A new tag always makes Coolify pull the new image.
- **Pinned version (recommended):** set `DISPATCH_VERSION` to the new release (see [releases](https://github.com/LSalami/dispatch/releases)) and click **Redeploy**. A new tag always makes Coolify pull the new image.
- **Tracking `latest`:** redeploy and make sure Coolify pulls the image again instead of reusing the cached `latest` (depending on your Coolify version, via the *pull latest images* option of the redeploy/restart action).

Read the [upgrade notes](upgrading.md) before jumping major versions, and take a backup first.
Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide gets Dispatch running locally and explains how the code is organized.
## Setup

```bash
git clone https://github.com/codextde/dispatch.git
git clone https://github.com/LSalami/dispatch.git
cd dispatch
corepack enable
pnpm install
Expand Down Expand Up @@ -109,7 +109,7 @@ The full list lives in [AGENTS.md](../AGENTS.md). The essentials:
## Building the Docker image locally

```bash
docker build -t ghcr.io/codextde/dispatch:dev .
docker build -t ghcr.io/lsalami/dispatch:dev .
echo "DISPATCH_VERSION=dev" >> .env # next to docker-compose.yml
docker compose up -d
```
Expand Down
8 changes: 8 additions & 0 deletions docs/imap-completion-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dispatch e Aruba

L'obiettivo è usare Dispatch come webmail per le caselle collegate, con lo storico disponibile via IMAP, le bozze sincronizzate e una copia locale leggera per le funzioni collaborative.

1. **Navigazione e identità dei messaggi.** Le cartelle e lo storico sono accessibili nella vista Cartelle sul server. Corpo e allegati vengono richiesti all'apertura. Il worker riconcilia gli spostamenti univoci dei messaggi già importati e sincronizza lo stato di lettura per le conversazioni con un solo messaggio nelle caselle personali abilitate.
2. **Identità delle bozze.** I tentativi ripetuti di copiare la stessa revisione usano un identificativo stabile. L'importazione della stessa copia remota riapre la bozza locale esistente, se ancora presente. Il collegamento attivato dal composer pubblica automaticamente i salvataggi successivi di Dispatch. Una revisione precedente viene rimossa solo quando posizione e contenuto sono verificati e il server supporta la cancellazione per UID. Dopo un invio confermato o uno scarto, il worker rimuove la copia remota solo se riconosce ancora la revisione esatta. Con il composer aperto, Dispatch recupera una modifica remota quando Aruba conserva il Message-ID e la nuova revisione è univoca. La apre come bozza separata per proteggere anche le modifiche locali non ancora salvate. Se Aruba cambia l’identificativo, la revisione rimane accessibile da Cartelle sul server. Criteri di accettazione: una modifica da un lato è visibile dall'altro, le modifiche concorrenti conservano entrambe le versioni, e invio o scarto non eliminano modifiche concorrenti.
3. **Recupero dello spazio.** La copia HTML dei messaggi ricevuti può essere rimossa per singolo messaggio dopo una verifica IMAP. Dispatch conserva il testo e recupera la formattazione all’apertura e quando cita il messaggio. Anche gli allegati si possono liberare per singolo messaggio dopo aver verificato i byte su IMAP. Download e inoltro usano il riferimento remoto. La pulizia in blocco è disponibile dalla vista Cartelle sul server per chi gestisce la casella. Si può fermare e riprendere nella stessa sessione. Verificare per ogni copia che il contenuto remoto corrisponda e proteggere gli allegati ancora referenziati. Conservare le copie dei messaggi senza un riscontro remoto certo. Misurare lo spazio prima e dopo su dati di prova.
4. **Verifica e rilascio.** Provare il flusso completo con una casella di test, includendo la riconnessione, la perdita della risposta dopo un salvataggio e lo spostamento da un altro client. Verificare poi i comportamenti specifici di Aruba prima di applicare la pulizia alle caselle reali.
6 changes: 3 additions & 3 deletions docs/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ A small cloud VM (e.g. 2 vCPU / 4 GB) comfortably serves a team of dozens with s
mkdir -p /opt/dispatch && cd /opt/dispatch

# 1. Get the compose file and the Caddy override (automatic HTTPS)
curl -fsSLO https://raw.githubusercontent.com/codextde/dispatch/main/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/codextde/dispatch/main/docker-compose.override.example.yml -o docker-compose.override.yml
curl -fsSLO https://raw.githubusercontent.com/LSalami/dispatch/main/docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/LSalami/dispatch/main/docker-compose.override.example.yml -o docker-compose.override.yml

# 2. Set your domain (the only setting)
echo "DOMAIN=mail.example.com" > .env
Expand Down Expand Up @@ -229,4 +229,4 @@ docker compose exec app sh # shell in the app
| Realtime updates only after refresh | A proxy is buffering Server-Sent Events. Disable buffering (`proxy_buffering off` in nginx). |
| `password authentication failed for user "dispatch"` | The secrets volume was recreated while the database was kept. Restart `db` first, which re-applies the password, then `app` and `worker`. |

Still stuck? Open a [discussion](https://github.com/codextde/dispatch/discussions) or a [bug report](https://github.com/codextde/dispatch/issues/new/choose) with the output of `docker compose ps` and the relevant logs (remove personal data).
Still stuck? Open a [discussion](https://github.com/LSalami/dispatch/discussions) or a [bug report](https://github.com/LSalami/dispatch/issues/new/choose) with the output of `docker compose ps` and the relevant logs (remove personal data).
4 changes: 2 additions & 2 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Upgrading

Dispatch follows [semantic versioning](https://semver.org). Minor and patch releases can be applied directly. Major releases may need manual steps, which are listed below and in the [release notes](https://github.com/codextde/dispatch/releases).
Dispatch follows [semantic versioning](https://semver.org). Minor and patch releases can be applied directly. Major releases may need manual steps, which are listed below and in the [release notes](https://github.com/LSalami/dispatch/releases).

Database migrations run automatically when the new version starts. They're idempotent and guarded by a Postgres advisory lock, so the app and worker never run them twice.

Expand Down Expand Up @@ -39,7 +39,7 @@ Image tags:
Also refresh `docker-compose.yml` from the repository when a release note says so:

```bash
curl -fsSLO https://raw.githubusercontent.com/codextde/dispatch/main/docker-compose.yml
curl -fsSLO https://raw.githubusercontent.com/LSalami/dispatch/main/docker-compose.yml
```

## Coolify
Expand Down
1 change: 1 addition & 0 deletions drizzle/0003_password_auth.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "users" ADD COLUMN IF NOT EXISTS "password_hash" text;
41 changes: 41 additions & 0 deletions drizzle/0004_calendar.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
CREATE TABLE "calendar_events" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"org_id" uuid NOT NULL,
"calendar_id" uuid NOT NULL,
"creator_id" uuid,
"conversation_id" uuid,
"ics" text NOT NULL,
"remote_path" text,
"etag" text,
"version" uuid DEFAULT gen_random_uuid() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "calendars" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"org_id" uuid NOT NULL,
"owner_id" uuid,
"account_id" uuid,
"name" text NOT NULL,
"remote_path" text,
"credential_enc" text,
"synced_at" timestamp with time zone,
"sync_error" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "calendar_events" ADD CONSTRAINT "calendar_events_org_id_organizations_id_fk" FOREIGN KEY ("org_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD CONSTRAINT "calendar_events_calendar_id_calendars_id_fk" FOREIGN KEY ("calendar_id") REFERENCES "public"."calendars"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD CONSTRAINT "calendar_events_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD CONSTRAINT "calendar_events_conversation_id_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."conversations"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendars" ADD CONSTRAINT "calendars_org_id_organizations_id_fk" FOREIGN KEY ("org_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendars" ADD CONSTRAINT "calendars_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "calendars" ADD CONSTRAINT "calendars_account_id_accounts_id_fk" FOREIGN KEY ("account_id") REFERENCES "public"."accounts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "calendar_events_org_calendar_idx" ON "calendar_events" USING btree ("org_id","calendar_id");--> statement-breakpoint
CREATE UNIQUE INDEX "calendar_events_remote_uidx" ON "calendar_events" USING btree ("calendar_id","remote_path");--> statement-breakpoint
CREATE INDEX "calendars_org_idx" ON "calendars" USING btree ("org_id");--> statement-breakpoint
CREATE UNIQUE INDEX "calendars_remote_uidx" ON "calendars" USING btree ("org_id","account_id","remote_path");
--> statement-breakpoint
UPDATE "roles" SET "permissions" = "permissions" || ARRAY['calendar.use'] WHERE "key" IN ('owner', 'admin', 'member') AND NOT ('calendar.use' = ANY("permissions"));
--> statement-breakpoint
UPDATE "roles" SET "permissions" = "permissions" || ARRAY['calendar.manage'] WHERE "key" IN ('owner', 'admin') AND NOT ('calendar.manage' = ANY("permissions"));
5 changes: 5 additions & 0 deletions drizzle/0005_calendar_invitations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE "calendar_events" ADD COLUMN "invitation_key" text;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD COLUMN "invitation_versions" jsonb;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD COLUMN "organizer_account_id" uuid;--> statement-breakpoint
ALTER TABLE "calendar_events" ADD CONSTRAINT "calendar_events_organizer_account_id_accounts_id_fk" FOREIGN KEY ("organizer_account_id") REFERENCES "public"."accounts"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "calendar_events_invitation_idx" ON "calendar_events" USING btree ("org_id","invitation_key");
Loading