summaryrefslogtreecommitdiff
path: root/db/schema/companies.ts
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema/companies.ts')
-rw-r--r--db/schema/companies.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/schema/companies.ts b/db/schema/companies.ts
new file mode 100644
index 00000000..60f8a0ce
--- /dev/null
+++ b/db/schema/companies.ts
@@ -0,0 +1,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