import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
import { InferModel } from "drizzle-orm";

export const hubspotProjectsData = pgTable("hubspot_projects_data", {
  id: uuid("id").defaultRandom().primaryKey(),

  projectId: text("project_id").notNull().unique(),
  name: text("name"),

  createdAt: timestamp("created_at", { precision: 6, withTimezone: true })
    .defaultNow()
    .notNull(),

  updatedAt: timestamp("updated_at", { precision: 6, withTimezone: true })
    .defaultNow()
    .$onUpdate(() => new Date())
    .notNull(),
});

export type HubspotProjectsData = InferModel<typeof hubspotProjectsData, "select">;
export type NewHubspotProjectsData = InferModel<typeof hubspotProjectsData, "insert">;
