summaryrefslogtreecommitdiff
path: root/db/schema/emailWhitelist.ts
blob: 485246eeb1b8c6337af74748ae166cd0401a155a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * 이메일 화이트리스트 관리
 *
 * 도메인(domain) 또는 개별 이메일(email)
 * - domain: 도메인 전체 화이트리스트용 (예: company.com)
 * - email: 개별 이메일 화이트리스트용 (예: user@company.com)
 * 설명(description)
 * 생성일(createdAt)
 * 생성자(createdBy)
 * 수정일(updatedAt)
 * 수정자(updatedBy)
 *
 */

import { pgTable, text, integer, serial, varchar, timestamp } from 'drizzle-orm/pg-core';
import { users } from './users';

export const emailWhitelist = pgTable("email_whitelist", {
  id: serial("id").primaryKey(),
  domain: varchar("domain", { length: 255 }), // 도메인 전체용 (nullable)
  email: varchar("email", { length: 255 }), // 개별 이메일용 (nullable)
  description: text("description"),
  createdAt: timestamp("created_at").defaultNow().notNull(),
  createdBy: integer("created_by").references(() => users.id),
  updatedAt: timestamp("updated_at").defaultNow().notNull(),
  updatedBy: integer("updated_by").references(() => users.id),
});