refactor: update organization

This commit is contained in:
Mauricio Siu
2025-02-15 20:25:58 -06:00
parent 87b12ff6e9
commit 53ce5e57fa
16 changed files with 5776 additions and 82 deletions
+3 -6
View File
@@ -25,6 +25,7 @@ import { sshKeys } from "./ssh-key";
import { users_temp } from "./user";
// import { user } from "./user";
import { generateAppName } from "./utils";
import { organization } from "./account";
export const serverStatus = pgEnum("serverStatus", ["active", "inactive"]);
@@ -43,13 +44,9 @@ export const server = pgTable("server", {
.$defaultFn(() => generateAppName("server")),
enableDockerCleanup: boolean("enableDockerCleanup").notNull().default(false),
createdAt: text("createdAt").notNull(),
// .$defaultFn(() => new Date().toISOString()),
// userId: text("userId")
// .notNull()
// .references(() => user.userId, { onDelete: "cascade" }),
userId: text("userId")
organizationId: text("organizationId")
.notNull()
.references(() => users_temp.id, { onDelete: "cascade" }),
.references(() => organization.id, { onDelete: "cascade" }),
serverStatus: serverStatus("serverStatus").notNull().default("active"),
command: text("command").notNull().default(""),
sshKeyId: text("sshKeyId").references(() => sshKeys.sshKeyId, {