/admin and with working with db. data is pulling from db
This commit is contained in:
+30
-17
@@ -424,7 +424,7 @@ export const accounts = pgTable("accounts", {
|
||||
|
||||
/* From here down is the authentication library Lusia tables */
|
||||
|
||||
export const users = pgTable("users",
|
||||
export const users = pgTable("user",
|
||||
{
|
||||
id: varchar("id", { length: 21 }).primaryKey(),
|
||||
name: varchar("name"),
|
||||
@@ -462,21 +462,16 @@ export const users = pgTable("users",
|
||||
export type User = typeof users.$inferSelect;
|
||||
export type NewUser = typeof users.$inferInsert;
|
||||
|
||||
export const sessions = pgTable(
|
||||
"sessions",
|
||||
{
|
||||
id: varchar("id", { length: 255 }).primaryKey(),
|
||||
userId: varchar("user_id", { length: 21 }).notNull(),
|
||||
expiresAt: timestamp("expires_at", { withTimezone: true, mode: "date" }).notNull(),
|
||||
createdAt: timestamp("created_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||
updatedAt: timestamp("updated_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||
},
|
||||
(t) => ({
|
||||
userIdx: index("session_user_idx").on(t.userId),
|
||||
}),
|
||||
);
|
||||
|
||||
export const emailVerificationCodes = pgTable(
|
||||
export const session = pgTable(
|
||||
"session",
|
||||
{
|
||||
sessionToken: varchar("sessionToken", { length: 255 }).primaryKey(),
|
||||
userId: varchar("userId", { length: 21 }).notNull(),
|
||||
expires: timestamp("expires", { withTimezone: true, mode: "date" }).notNull(),
|
||||
}
|
||||
);
|
||||
|
||||
export const emailVerificationCodes = pgTable(
|
||||
"email_verification_codes",
|
||||
{
|
||||
id: serial("id").primaryKey(),
|
||||
@@ -555,4 +550,22 @@ export const sessions = pgTable(
|
||||
// price: integer("price"),
|
||||
// createdAt: timestamp("created_at").defaultNow(),
|
||||
// // Add more fields as needed
|
||||
// });
|
||||
// });
|
||||
|
||||
export const affiliateCategoryMap = pgTable("affiliate_category_map", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "affiliate_category_map_id_seq", startWith: 1, increment: 1 }),
|
||||
feedname: varchar("feedname", { length: 100 }).notNull(),
|
||||
affiliatecategory: varchar("affiliatecategory", { length: 255 }).notNull(),
|
||||
buildercategoryid: integer("buildercategoryid").notNull(),
|
||||
notes: varchar("notes", { length: 255 }),
|
||||
});
|
||||
|
||||
export const product_categories = pgTable("product_categories", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "product_categories_id_seq", startWith: 1, increment: 1 }),
|
||||
name: varchar({ length: 100 }).notNull(),
|
||||
parent_category_id: integer("parent_category_id"),
|
||||
type: varchar({ length: 50 }),
|
||||
sort_order: integer("sort_order"),
|
||||
created_at: timestamp("created_at", { mode: 'string' }).defaultNow(),
|
||||
updated_at: timestamp("updated_at", { mode: 'string' }).defaultNow(),
|
||||
});
|
||||
Reference in New Issue
Block a user