import { pgTable, bigserial, text, bigint } from "drizzle-orm/pg-core";
import { uploadedFiles } from "../uploaded_files";

export const magicPlanPlan = pgTable(
  "magic_plan_plan",
  {
    id:             bigserial("id", { mode: "bigint" }).primaryKey(),
    name:           text("name"),
    address:        text("address"),
    postcode:       text("postcode"),
    magicPlanUid:   text("magic_plan_uid").unique(),
    uploadedFileId: bigint("uploaded_file_id", { mode: "bigint" })
          .unique()
          .references(() => uploadedFiles.id),
  },
);