feat: add notifications table and Electric SQL replication setup

- Introduced a new notifications table with relevant fields and indexes.
- Configured Electric SQL replication for the notifications, search_source_connectors, and documents tables.
- Centralized Electric SQL user credentials in the migration script for better management.
- Ensured idempotency in the migration process for creating users and publications.
This commit is contained in:
Anish Sarkar 2026-01-15 03:28:10 +05:30
parent 2e0f742000
commit 31a5581af1
3 changed files with 3077 additions and 3017 deletions

View file

@ -1,7 +1,7 @@
"""Add notifications table and Electric SQL replication """Add notifications table and Electric SQL replication
Revision ID: 62 Revision ID: 64
Revises: 61 Revises: 63
Creates notifications table and sets up Electric SQL replication Creates notifications table and sets up Electric SQL replication
(user, publication, REPLICA IDENTITY FULL) for notifications, (user, publication, REPLICA IDENTITY FULL) for notifications,
@ -18,8 +18,8 @@ ELECTRIC_DB_USER = _config.get_main_option("electric_db_user", "electric")
ELECTRIC_DB_PASSWORD = _config.get_main_option("electric_db_password", "electric_password") ELECTRIC_DB_PASSWORD = _config.get_main_option("electric_db_password", "electric_password")
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision: str = "62" revision: str = "64"
down_revision: str | None = "61" down_revision: str | None = "63"
branch_labels: str | Sequence[str] | None = None branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None depends_on: str | Sequence[str] | None = None

6082
surfsense_backend/uv.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
"use client"; "use client";
import { ChevronDown, ChevronUp, FileX, Plus } from "lucide-react"; import { ChevronDown, ChevronUp, FileX, Loader2, Plus } from "lucide-react";
import { motion } from "motion/react"; import { motion } from "motion/react";
import { useParams } from "next/navigation"; import { useParams } from "next/navigation";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
@ -114,7 +114,7 @@ export function DocumentsTableShell({
{loading ? ( {loading ? (
<div className="flex h-[400px] w-full items-center justify-center"> <div className="flex h-[400px] w-full items-center justify-center">
<div className="flex flex-col items-center gap-2"> <div className="flex flex-col items-center gap-2">
<div className="h-8 w-8 animate-spin rounded-full border-b-2 border-primary"></div> <Loader2 className="h-8 w-8 animate-spin text-primary" />
<p className="text-sm text-muted-foreground">{t("loading")}</p> <p className="text-sm text-muted-foreground">{t("loading")}</p>
</div> </div>
</div> </div>