task h.1 adn fix permission

This commit is contained in:
phaichayon
2026-06-16 15:13:14 +07:00
parent 9ae41e4f2c
commit 90ee59d388
29 changed files with 3807 additions and 119 deletions

View File

@@ -3,7 +3,7 @@ CREATE TABLE "memberships" (
"user_id" text NOT NULL,
"organization_id" text NOT NULL,
"role" text DEFAULT 'user' NOT NULL,
"business_role" text DEFAULT 'viewer' NOT NULL,
"business_role" text DEFAULT 'sales_support' NOT NULL,
"permissions" text[] DEFAULT '{}' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
@@ -45,4 +45,4 @@ CREATE TABLE "users" (
);
--> statement-breakpoint
CREATE UNIQUE INDEX "organizations_slug_idx" ON "organizations" USING btree ("slug");--> statement-breakpoint
CREATE UNIQUE INDEX "users_email_idx" ON "users" USING btree ("email");
CREATE UNIQUE INDEX "users_email_idx" ON "users" USING btree ("email");

View File

@@ -0,0 +1,5 @@
ALTER TABLE "crm_enquiries" ADD COLUMN "assigned_to_user_id" text;--> statement-breakpoint
ALTER TABLE "crm_enquiries" ADD COLUMN "assigned_at" timestamp with time zone;--> statement-breakpoint
ALTER TABLE "crm_enquiries" ADD COLUMN "assigned_by" text;--> statement-breakpoint
ALTER TABLE "crm_enquiries" ADD COLUMN "assignment_remark" text;--> statement-breakpoint
ALTER TABLE "memberships" ALTER COLUMN "business_role" SET DEFAULT 'sales_support';

File diff suppressed because it is too large Load Diff

View File

@@ -57,6 +57,13 @@
"when": 1781589458455,
"tag": "0007_luxuriant_malice",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1781595962545,
"tag": "0008_clean_justin_hammer",
"breakpoints": true
}
]
}