From 5a2b08505acdde6a7f6853815945ae4ebafce276 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 23 Mar 2026 12:26:31 +0000 Subject: [PATCH] renaming organisation and team columns --- src/app/db/schema/organisation.ts | 2 +- src/app/db/schema/team.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/db/schema/organisation.ts b/src/app/db/schema/organisation.ts index 2358104f..4889037d 100644 --- a/src/app/db/schema/organisation.ts +++ b/src/app/db/schema/organisation.ts @@ -10,7 +10,7 @@ export const organisation = pgTable("organisation", { .defaultNow() .notNull(), hubspotCompanyId: text("hubspot_company_id"), - companyName: text("company_name"), + name: text("name"), }); export type Organisation = InferModel; diff --git a/src/app/db/schema/team.ts b/src/app/db/schema/team.ts index e89e1e20..39f9a1f0 100644 --- a/src/app/db/schema/team.ts +++ b/src/app/db/schema/team.ts @@ -6,8 +6,10 @@ import { portfolio, roleEnum } from "./portfolio"; export const team = pgTable("team", { id: uuid("id").defaultRandom().primaryKey(), - teamName: text("team_name").notNull(), - orgId: uuid("org_id").notNull().references(() => organisation.id), + name: text("name").notNull(), + orgId: uuid("org_id") + .notNull() + .references(() => organisation.id), createdAt: timestamp("created_at", { precision: 6, withTimezone: true }) .defaultNow() .notNull(), @@ -21,7 +23,9 @@ export const teamMembers = pgTable("team_members", { userId: bigint("user_id", { mode: "bigint" }) .notNull() .references(() => user.id), - teamId: uuid("team_id").notNull().references(() => team.id), + teamId: uuid("team_id") + .notNull() + .references(() => team.id), createdAt: timestamp("created_at", { precision: 6, withTimezone: true }) .defaultNow() .notNull(), @@ -32,7 +36,9 @@ export const teamMembers = pgTable("team_members", { export const teamPortfolioPermissions = pgTable("team_portfolio_permissions", { id: uuid("id").defaultRandom().primaryKey(), - teamId: uuid("team_id").notNull().references(() => team.id), + teamId: uuid("team_id") + .notNull() + .references(() => team.id), portfolioId: bigint("portfolio_id", { mode: "bigint" }) .notNull() .references(() => portfolio.id),