diff --git a/backend/app/core/migrations.py b/backend/app/core/migrations.py index d784d6a..62f79ea 100644 --- a/backend/app/core/migrations.py +++ b/backend/app/core/migrations.py @@ -1,4 +1,19 @@ -"""Lightweight schema sync for SQLite + one-shot migration helpers. +"""Lightweight schema sync + one-shot migration helpers. + +THIS MANAGES THE PRODUCTION POSTGRES SCHEMA, not just SQLite. The header +used to say "for SQLite", and every caveat below is still written in +SQLite terms, which reads as though this were self-host-only machinery. +It is not: ``app/main.py`` calls ``sync_schema(engine, Base.metadata)`` +unconditionally on every boot, against whatever engine is configured — +Postgres on Fly, SQLite for a self-hosted install. There is no Alembic +in this repo, so this module plus ``create_all`` IS the schema +management for production. + +Two of the SQLite caveats below read differently on Postgres: adding a +NOT NULL column without a default fails there too, but an ADD COLUMN +with a non-volatile default is metadata-only and fast (PG11+), where +SQLite rewrites. The "renames, type changes and drops need a real +migration" caveat applies equally to both. Two kinds of function live here: diff --git a/frontend/src/hooks/useMotionAlerts.jsx b/frontend/src/hooks/useMotionAlerts.jsx index dc1f02b..e1151d4 100644 --- a/frontend/src/hooks/useMotionAlerts.jsx +++ b/frontend/src/hooks/useMotionAlerts.jsx @@ -133,6 +133,5 @@ export function useMotionAlerts(cameras) { abortRef.current?.abort() } // orgId: tear down + reconnect the stream under the new org's token. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [getToken, showToast, orgId]) } diff --git a/frontend/src/hooks/useNotifications.jsx b/frontend/src/hooks/useNotifications.jsx index a1f062c..4a9e3d4 100644 --- a/frontend/src/hooks/useNotifications.jsx +++ b/frontend/src/hooks/useNotifications.jsx @@ -213,7 +213,6 @@ export function useNotifications() { controller?.abort() } // orgId: tear down + reconnect the stream under the new org's token. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [getToken, orgId]) return { diff --git a/frontend/src/pages/AdminPage.jsx b/frontend/src/pages/AdminPage.jsx index 1df20ad..e50450d 100644 --- a/frontend/src/pages/AdminPage.jsx +++ b/frontend/src/pages/AdminPage.jsx @@ -303,7 +303,6 @@ function AdminPage() { if (reader) reader.cancel().catch(() => {}) } // eslint-disable-next-line react-hooks/exhaustive-deps - // eslint-disable-next-line react-hooks/exhaustive-deps }, [organization?.id, hasAdminFeature]) const handleMcpFilterChange = (key, value) => {