Skip to content

Commit

Permalink
removed unnecessary field
Browse files Browse the repository at this point in the history
  • Loading branch information
suxls committed Jan 23, 2025
1 parent 3787b05 commit ed6bea7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions packages/db/src/schema/companyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ export const CompanyRequest = pgTable("company_request", {
roleTitle: varchar("title").notNull(),
roleDescription: text("description"),
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt", {
mode: "date",
withTimezone: true,
}).$onUpdateFn(() => sql`now()`),
status: varchar("status", {
enum: ["PENDING", "APPROVED", "REJECTED"], // Explicitly list the enum values
})
Expand Down Expand Up @@ -47,6 +43,5 @@ export const CreateCompanyRequestSchema = createInsertSchema(CompanyRequest, {
}).omit({
id: true,
createdAt: true,
updatedAt: true,
});
// Example TypeScript type for the Company Request
10 changes: 5 additions & 5 deletions packages/db/src/schema/roleRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import { z } from "zod";

import { Company } from "./companies";
import { RequestStatus } from "./misc";
import { Profile } from "./profiles";

export const RoleRequest = pgTable("role_request", {
id: uuid("id").notNull().primaryKey().defaultRandom(),
roleTitle: varchar("title").notNull(),
roleDescription: text("description"),
companyId: varchar("companyId").notNull(),
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt", {
mode: "date",
withTimezone: true,
}).$onUpdateFn(() => sql`now()`),
status: varchar("status", {
enum: ["PENDING", "APPROVED", "REJECTED"], // Explicitly list the enum values (?)
})
Expand All @@ -30,6 +27,10 @@ export const RoleRequestRelations = relations(RoleRequest, ({ one }) => ({
fields: [RoleRequest.companyId],
references: [Company.id],
}),
profile: one(Profile, {
fields: [RoleRequest.id],
references: [Profile.userId],
}),
}));

/*
Expand All @@ -44,5 +45,4 @@ export const CreateCompanyRequestSchema = createInsertSchema(RoleRequest, {
}).omit({
id: true,
createdAt: true,
updatedAt: true,
});

0 comments on commit ed6bea7

Please sign in to comment.