renaming organisation and team columns

This commit is contained in:
Khalim Conn-Kowlessar 2026-03-23 12:26:31 +00:00
parent b664f10fec
commit 5a2b08505a
2 changed files with 11 additions and 5 deletions

View file

@ -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<typeof organisation, "select">;

View file

@ -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),