summaryrefslogtreecommitdiff
path: root/db/schema/companies.ts
blob: 60f8a0ce0f14950f4d1f72bb32cd940f2e59e894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { pgTable, varchar, integer, timestamp } from "drizzle-orm/pg-core";

export const companies = pgTable("companies", {
  id: integer("id").primaryKey().generatedAlwaysAsIdentity(),
  name: varchar("name", { length: 255 }).notNull(),
  taxID: integer("taxID").notNull(),
  // 회사가 여러 군데일 경우를 대비하여 unique는 걸지 않을 수도 있음
  createdAt: timestamp("created_at", { withTimezone: true })
    .defaultNow()
    .notNull(),
});

export type Company = typeof companies.$inferSelect