refactor: update

This commit is contained in:
Mauricio Siu
2025-02-14 02:40:11 -06:00
parent ca217affe6
commit b6c29ccf05
18 changed files with 154 additions and 147 deletions

View File

@@ -1,7 +1,7 @@
import { relations } from "drizzle-orm";
import { boolean, pgTable, text, timestamp } from "drizzle-orm/pg-core";
import { nanoid } from "nanoid";
import { users_temp } from "./user";
import { relations } from "drizzle-orm";
export const account = pgTable("account", {
id: text("id")

View File

@@ -13,6 +13,7 @@ import { z } from "zod";
import { admins } from "./admin";
import { auth } from "./auth";
import { certificateType } from "./shared";
import { account } from "./account";
/**
* This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same
* database instance for multiple projects.
@@ -185,10 +186,14 @@ export const users_temp = pgTable("user_temp", {
serversQuantity: integer("serversQuantity").notNull().default(0),
});
export const usersRelations = relations(users, ({ one }) => ({
auth: one(auth, {
fields: [users.authId],
references: [auth.id],
export const usersRelations = relations(users_temp, ({ one }) => ({
// auth: one(auth, {
// fields: [users.authId],
// references: [auth.id],
// }),
account: one(account, {
fields: [users_temp.id],
references: [account.userId],
}),
// admin: one(admins, {
// fields: [users.adminId],