ThreadCount Community edition

Uniform stock management for healthcare linen rooms. Licensed under the GNU AGPL v3.
This commit is contained in:
ThreadCount
2026-09-13 08:45:19 +10:00
commit 1bc2de655a
505 changed files with 56223 additions and 0 deletions
@@ -0,0 +1,24 @@
-- Platform switches the console can flip without a deploy, and the billing scaffold.
CREATE TABLE "PlatformSwitch" (
"id" TEXT NOT NULL DEFAULT 'platform',
"signupsDisabled" BOOLEAN NOT NULL DEFAULT false,
"demoDisabled" BOOLEAN NOT NULL DEFAULT false,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "PlatformSwitch_pkey" PRIMARY KEY ("id")
);
ALTER TABLE "Facility" ADD COLUMN "plan" TEXT NOT NULL DEFAULT '',
ADD COLUMN "planNote" TEXT NOT NULL DEFAULT '';
-- The console may read the two new control-plane columns. Guarded like every ops grant: no role,
-- no grant, no failed deploy. (`prisma migrate deploy` runs as the app role, which owns the table,
-- so the grant itself needs no more than that.)
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'ops_ro') THEN
RAISE NOTICE 'ops_ro does not exist — plan grants skipped';
RETURN;
END IF;
GRANT SELECT ("plan", "planNote") ON "Facility" TO ops_ro;
END $$;