- 자동 로그인 로직 cookie 로 변경
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
import { pgTable, foreignKey, uuid, text, date, boolean, index, varchar, primaryKey } from "drizzle-orm/pg-core"
|
||||
import { pgTable, foreignKey, uuid, text, date, boolean, varchar, index, time, primaryKey, pgSequence } from "drizzle-orm/pg-core"
|
||||
import { sql } from "drizzle-orm"
|
||||
|
||||
|
||||
export const versionIdSeq = pgSequence("version_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const accessTokenIdSeq = pgSequence("access_token_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const oauth2ApplicationIdSeq = pgSequence("oauth2_application_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const oauth2AuthorizationCodeIdSeq = pgSequence("oauth2_authorization_code_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const oauth2GrantIdSeq = pgSequence("oauth2_grant_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const loginSourceIdSeq = pgSequence("login_source_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const twoFactorIdSeq = pgSequence("two_factor_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const webauthnCredentialIdSeq = pgSequence("webauthn_credential_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const dbfsMetaIdSeq = pgSequence("dbfs_meta_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const dbfsDataIdSeq = pgSequence("dbfs_data_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const noticeIdSeq = pgSequence("notice_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const systemSettingIdSeq = pgSequence("system_setting_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const badgeIdSeq = pgSequence("badge_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const userBadgeIdSeq = pgSequence("user_badge_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const userBlockingIdSeq = pgSequence("user_blocking_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
export const emailAddressIdSeq = pgSequence("email_address_id_seq", { startWith: "1", increment: "1", minValue: "1", maxValue: "9223372036854775807", cache: "1", cycle: false })
|
||||
|
||||
export const comment = pgTable("comment", {
|
||||
id: uuid().primaryKey().notNull(),
|
||||
@@ -23,30 +39,6 @@ export const comment = pgTable("comment", {
|
||||
}),
|
||||
]);
|
||||
|
||||
export const schedule = pgTable("schedule", {
|
||||
id: uuid().primaryKey().notNull(),
|
||||
name: varchar(),
|
||||
startAt: date("start_at"),
|
||||
endAt: date("end_at"),
|
||||
status: varchar(),
|
||||
content: text(),
|
||||
isDeleted: boolean("is_deleted").default(false),
|
||||
type: varchar(),
|
||||
createdAt: date("created_at"),
|
||||
owner: uuid(),
|
||||
}, (table) => [
|
||||
index("schedule_enddatetime_idx").using("btree", table.endAt.asc().nullsLast().op("date_ops")),
|
||||
index("schedule_name_idx").using("btree", table.name.asc().nullsLast().op("text_ops"), table.content.asc().nullsLast().op("text_ops")),
|
||||
index("schedule_startdatetime_idx").using("btree", table.startAt.asc().nullsLast().op("date_ops")),
|
||||
index("schedule_status_idx").using("btree", table.status.asc().nullsLast().op("text_ops")),
|
||||
index("schedule_type_idx").using("btree", table.type.asc().nullsLast().op("text_ops")),
|
||||
foreignKey({
|
||||
columns: [table.owner],
|
||||
foreignColumns: [account.id],
|
||||
name: "schedule_user_fk"
|
||||
}),
|
||||
]);
|
||||
|
||||
export const account = pgTable("account", {
|
||||
name: varchar().notNull(),
|
||||
email: varchar().notNull(),
|
||||
@@ -79,6 +71,33 @@ export const participant = pgTable("participant", {
|
||||
}),
|
||||
]);
|
||||
|
||||
export const schedule = pgTable("schedule", {
|
||||
id: uuid().primaryKey().notNull(),
|
||||
name: varchar(),
|
||||
startDate: date("start_date"),
|
||||
endDate: date("end_date"),
|
||||
status: varchar(),
|
||||
content: text(),
|
||||
isDeleted: boolean("is_deleted").default(false),
|
||||
type: varchar(),
|
||||
createdAt: date("created_at"),
|
||||
owner: uuid(),
|
||||
style: varchar(),
|
||||
startTime: time("start_time"),
|
||||
endTime: time("end_time"),
|
||||
}, (table) => [
|
||||
index("schedule_enddatetime_idx").using("btree", table.endDate.asc().nullsLast().op("date_ops")),
|
||||
index("schedule_name_idx").using("btree", table.name.asc().nullsLast().op("text_ops"), table.content.asc().nullsLast().op("text_ops")),
|
||||
index("schedule_startdatetime_idx").using("btree", table.startDate.asc().nullsLast().op("date_ops")),
|
||||
index("schedule_status_idx").using("btree", table.status.asc().nullsLast().op("text_ops")),
|
||||
index("schedule_type_idx").using("btree", table.type.asc().nullsLast().op("text_ops")),
|
||||
foreignKey({
|
||||
columns: [table.owner],
|
||||
foreignColumns: [account.id],
|
||||
name: "schedule_user_fk"
|
||||
}),
|
||||
]);
|
||||
|
||||
export const favorite = pgTable("favorite", {
|
||||
isDeleted: boolean("is_deleted").default(false),
|
||||
createdAt: date("created_at"),
|
||||
|
||||
Reference in New Issue
Block a user