diff --git a/server/db/pg/schema/schema.ts b/server/db/pg/schema/schema.ts index f9be4601..e2cc3f4e 100644 --- a/server/db/pg/schema/schema.ts +++ b/server/db/pg/schema/schema.ts @@ -661,24 +661,6 @@ export const olmSessions = pgTable("clientSession", { expiresAt: bigint("expiresAt", { mode: "number" }).notNull() }); -export const userClients = pgTable("userClients", { - userId: varchar("userId") - .notNull() - .references(() => users.userId, { onDelete: "cascade" }), - clientId: integer("clientId") - .notNull() - .references(() => clients.clientId, { onDelete: "cascade" }) -}); - -export const roleClients = pgTable("roleClients", { - roleId: integer("roleId") - .notNull() - .references(() => roles.roleId, { onDelete: "cascade" }), - clientId: integer("clientId") - .notNull() - .references(() => clients.clientId, { onDelete: "cascade" }) -}); - export const securityKeys = pgTable("webauthnCredentials", { credentialId: varchar("credentialId").primaryKey(), userId: varchar("userId") @@ -822,8 +804,6 @@ export type Client = InferSelectModel; export type ClientSite = InferSelectModel; export type Olm = InferSelectModel; export type OlmSession = InferSelectModel; -export type UserClient = InferSelectModel; -export type RoleClient = InferSelectModel; export type OrgDomains = InferSelectModel; export type SiteResource = InferSelectModel; export type SetupToken = InferSelectModel; diff --git a/server/db/sqlite/schema/schema.ts b/server/db/sqlite/schema/schema.ts index fa2f7439..f057e2f4 100644 --- a/server/db/sqlite/schema/schema.ts +++ b/server/db/sqlite/schema/schema.ts @@ -318,10 +318,10 @@ export const clients = sqliteTable("clients", { // optionally tied to a user and in this case delete when the user deletes onDelete: "cascade" }), - + name: text("name").notNull(), pubKey: text("pubKey"), - olmId: text("olmId"), // to lock it to a specific olm optionally + olmId: text("olmId"), // to lock it to a specific olm optionally subnet: text("subnet").notNull(), megabytesIn: integer("bytesIn"), megabytesOut: integer("bytesOut"), @@ -492,24 +492,6 @@ export const userSites = sqliteTable("userSites", { .references(() => sites.siteId, { onDelete: "cascade" }) }); -export const userClients = sqliteTable("userClients", { - userId: text("userId") - .notNull() - .references(() => users.userId, { onDelete: "cascade" }), - clientId: integer("clientId") - .notNull() - .references(() => clients.clientId, { onDelete: "cascade" }) -}); - -export const roleClients = sqliteTable("roleClients", { - roleId: integer("roleId") - .notNull() - .references(() => roles.roleId, { onDelete: "cascade" }), - clientId: integer("clientId") - .notNull() - .references(() => clients.clientId, { onDelete: "cascade" }) -}); - export const roleResources = sqliteTable("roleResources", { roleId: integer("roleId") .notNull() @@ -864,8 +846,6 @@ export type Domain = InferSelectModel; export type DnsRecord = InferSelectModel; export type Client = InferSelectModel; export type ClientSite = InferSelectModel; -export type RoleClient = InferSelectModel; -export type UserClient = InferSelectModel; export type SupporterKey = InferSelectModel; export type Idp = InferSelectModel; export type ApiKey = InferSelectModel;