upd
This commit is contained in:
@@ -2,12 +2,16 @@ import { pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
||||
import { companiesTable } from "./companies";
|
||||
import { relations } from "drizzle-orm";
|
||||
import { sessionsTable } from "./sessions";
|
||||
import { usersTable } from "./users";
|
||||
|
||||
export const clientsTable = pgTable("clients", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
fullname: varchar("fullname").notNull(),
|
||||
email: varchar("email").notNull(),
|
||||
phone: varchar("phone", { length: 15 }),
|
||||
name: varchar("name").notNull(),
|
||||
phone: varchar("phone", { length: 11 }).notNull(),
|
||||
email: varchar("email"),
|
||||
ownerId: uuid("owner_id")
|
||||
.notNull()
|
||||
.references(() => usersTable.id),
|
||||
companyId: uuid("company_id")
|
||||
.notNull()
|
||||
.references(() => companiesTable.id),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
||||
import { companiesTable } from "./companies";
|
||||
import { actionsTable } from "./actions";
|
||||
import { relations } from "drizzle-orm";
|
||||
import { sessionsTable } from "./sessions";
|
||||
import { appsTable } from "./apps";
|
||||
|
||||
export const serversTable = pgTable("servers", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
@@ -27,5 +27,5 @@ export const serversRelations = relations(serversTable, ({ one, many }) => ({
|
||||
references: [companiesTable.id],
|
||||
}),
|
||||
sessions: many(sessionsTable),
|
||||
actions: many(actionsTable),
|
||||
apps: many(appsTable),
|
||||
}));
|
||||
|
||||
@@ -19,7 +19,9 @@ export const sessionsTable = pgTable(
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
status: varchar("status", {
|
||||
enum: ["starting", "started", "restarting", "ending", "ended"],
|
||||
}).notNull(),
|
||||
})
|
||||
.notNull()
|
||||
.default("starting"),
|
||||
appId: uuid("app_id")
|
||||
.notNull()
|
||||
.references(() => appsTable.id),
|
||||
|
||||
Reference in New Issue
Block a user