Added Public Links
This commit is contained in:
@@ -70,4 +70,5 @@ export * from "./vehicles"
|
||||
export * from "./vendors"
|
||||
export * from "./staff_time_events"
|
||||
export * from "./serialtypes"
|
||||
export * from "./serialexecutions"
|
||||
export * from "./serialexecutions"
|
||||
export * from "./public_links"
|
||||
30
db/schema/public_links.ts
Normal file
30
db/schema/public_links.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { pgTable, text, integer, boolean, jsonb, timestamp, uuid } from 'drizzle-orm/pg-core';
|
||||
import { tenants } from './tenants';
|
||||
import { authProfiles } from './auth_profiles';
|
||||
|
||||
export const publicLinks = pgTable('public_links', {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
|
||||
// Der öffentliche Token (z.B. "werkstatt-tablet-01")
|
||||
token: text('token').notNull().unique(),
|
||||
|
||||
// Zuordnung zum Tenant (WICHTIG für die Datentrennung)
|
||||
tenant: integer('tenant').references(() => tenants.id).notNull(),
|
||||
|
||||
defaultProfile: uuid('default_profile').references(() => authProfiles.id),
|
||||
|
||||
// Sicherheit
|
||||
isProtected: boolean('is_protected').default(false).notNull(),
|
||||
pinHash: text('pin_hash'),
|
||||
|
||||
// Konfiguration (JSON)
|
||||
config: jsonb('config').default({}),
|
||||
|
||||
// Metadaten
|
||||
name: text('name').notNull(),
|
||||
description: text('description'),
|
||||
|
||||
active: boolean('active').default(true).notNull(),
|
||||
createdAt: timestamp('created_at').defaultNow(),
|
||||
updatedAt: timestamp('updated_at').defaultNow(),
|
||||
});
|
||||
Reference in New Issue
Block a user