- Schema: add PolicyGroup, ClientMember, claimsAdvocateId; migrations included - API: /api/clients/[id]/team (flat ClientMember), /api/clients/[id]/policy-groups - API: /api/policy-groups, /api/tasks/bulk-assign, /api/cron/auto-generate - API: /api/admin/audit, filter clients by advocateId/teamMemberId (name format fix) - API: /api/users supports department filter - UI: policy-group-manager, client-detail assignments card (combobox, claims dept filter) - UI: bulk assign page /tasks/assign, audit log viewer /admin/audit - UI: nav-bar Assign Tasks link, admin audit log link - UI: combobox component with search/filter - Auth: audit logging for sign-in, user role changes - Fix: Prisma client regenerated for new schema fields - Fix: teamMemberId filter uses Last,First name format for policy matching - Fix: suppressHydrationWarning on all formatDate spans
46 lines
1.5 KiB
SQL
46 lines
1.5 KiB
SQL
/*
|
|
Warnings:
|
|
|
|
- You are about to drop the `client_team_members` table. If the table is not empty, all the data it contains will be lost.
|
|
- You are about to drop the `client_teams` table. If the table is not empty, all the data it contains will be lost.
|
|
|
|
*/
|
|
-- DropForeignKey
|
|
ALTER TABLE "client_team_members" DROP CONSTRAINT "client_team_members_team_id_fkey";
|
|
|
|
-- DropForeignKey
|
|
ALTER TABLE "client_team_members" DROP CONSTRAINT "client_team_members_user_id_fkey";
|
|
|
|
-- DropForeignKey
|
|
ALTER TABLE "client_teams" DROP CONSTRAINT "client_teams_client_id_fkey";
|
|
|
|
-- DropTable
|
|
DROP TABLE "client_team_members";
|
|
|
|
-- DropTable
|
|
DROP TABLE "client_teams";
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "client_members" (
|
|
"id" TEXT NOT NULL,
|
|
"client_id" TEXT NOT NULL,
|
|
"user_id" TEXT NOT NULL,
|
|
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "client_members_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "client_members_client_id_idx" ON "client_members"("client_id");
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "client_members_user_id_idx" ON "client_members"("user_id");
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "client_members_client_id_user_id_key" ON "client_members"("client_id", "user_id");
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "client_members" ADD CONSTRAINT "client_members_client_id_fkey" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "client_members" ADD CONSTRAINT "client_members_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|