-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
13,189 additions
and
506 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,5 +52,8 @@ | |
"node": "^20.9.0", | ||
"pnpm": "^8.0.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"uuid": "^11.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { InferSelectModel } from "drizzle-orm"; | ||
import { int, varchar, timestamp, mysqlTable } from "drizzle-orm/mysql-core"; | ||
|
||
export const OrganizationTypeEnum = mysqlTable("org_typ_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const OrganizationPresidentTypeEnum = mysqlTable("org_pre_typ_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const BudgetDomainEnum = mysqlTable("bud_dom_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const BudgetDivisionIncomeEnum = mysqlTable("bud_div_inc_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const BudgetDivisionExpenseEnum = mysqlTable("bud_div_exp_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const BudgetClassExpenseEnum = mysqlTable("bud_cla_exp_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const TransactionTypeEnum = mysqlTable("tra_typ_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const ReportFileTypeEnum = mysqlTable("rep_fil_typ_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export const AssistantPermissionEnum = mysqlTable("ass_per_e", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}); | ||
|
||
export type OrganizationTypeEnumT = InferSelectModel< | ||
typeof OrganizationTypeEnum | ||
>; | ||
export type OrganizationPresidentTypeEnumT = InferSelectModel< | ||
typeof OrganizationPresidentTypeEnum | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
int, | ||
varchar, | ||
datetime, | ||
timestamp, | ||
mysqlTable, | ||
foreignKey, | ||
} from "drizzle-orm/mysql-core"; | ||
import { v4 as uuidv4 } from "uuid"; | ||
import { User } from "./user.schema"; | ||
|
||
function createUuid(): string { | ||
return uuidv4(); | ||
} | ||
|
||
export const File = mysqlTable( | ||
"file", | ||
{ | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
uuid: varchar("uuid", { length: 128 }) | ||
.$defaultFn(() => createUuid()) | ||
.unique(), | ||
name: varchar("name", { length: 255 }).notNull(), | ||
extension: varchar("extension", { length: 255 }).notNull(), | ||
size: int("size").notNull(), | ||
userId: int("user_id").notNull(), | ||
signedAt: datetime("signed_at").notNull(), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}, | ||
table => ({ | ||
userIdFk: foreignKey({ | ||
columns: [table.userId], | ||
foreignColumns: [User.id], | ||
}), | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export * from "./enum.schema"; | ||
export * from "./user.schema"; | ||
export * from "./semester.schema"; | ||
export * from "./organization.schema"; | ||
export * from "./meeting.schema"; | ||
export * from "./proposal.schema"; | ||
export * from "./file.schema"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { | ||
int, | ||
varchar, | ||
text, | ||
date, | ||
timestamp, | ||
boolean, | ||
mysqlTable, | ||
foreignKey, | ||
} from "drizzle-orm/mysql-core"; | ||
|
||
export const Meeting = mysqlTable("meeting", { | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
startTerm: date("start_term").notNull(), | ||
endTerm: date("end_term"), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
name: varchar("name", { length: 30 }).notNull(), | ||
detail: text("detail"), | ||
}); | ||
|
||
export const Agenda = mysqlTable( | ||
"agenda", | ||
{ | ||
id: int("id").autoincrement().primaryKey().notNull(), | ||
meetingId: int("meeting_id").notNull(), | ||
accepted: boolean("accepted"), | ||
createdAt: timestamp("created_at").defaultNow().notNull(), | ||
submittedAt: timestamp("submitted_at"), | ||
postedAt: timestamp("posted_at"), | ||
updatedAt: timestamp("updated_at").defaultNow().onUpdateNow().notNull(), | ||
deletedAt: timestamp("deleted_at"), | ||
}, | ||
table => ({ | ||
meetingIdFk: foreignKey({ | ||
columns: [table.meetingId], | ||
foreignColumns: [Meeting.id], | ||
}), | ||
}), | ||
); |
Oops, something went wrong.