mirror of
https://github.com/samanhappy/mcphub.git
synced 2026-01-01 12:18:39 -05:00
Add PostgreSQL-backed data storage support (#444)
Co-authored-by: samanhappy <samanhappy@gmail.com>
This commit is contained in:
43
src/db/entities/SystemConfig.ts
Normal file
43
src/db/entities/SystemConfig.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
/**
|
||||
* System configuration entity for database storage
|
||||
* Using singleton pattern - only one record with id = 'default'
|
||||
*/
|
||||
@Entity({ name: 'system_config' })
|
||||
export class SystemConfig {
|
||||
@PrimaryColumn({ type: 'varchar', length: 50, default: 'default' })
|
||||
id: string;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
routing?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
install?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
smartRouting?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
mcpRouter?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'varchar', length: 10, nullable: true })
|
||||
nameSeparator?: string;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
oauth?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'simple-json', nullable: true })
|
||||
oauthServer?: Record<string, any>;
|
||||
|
||||
@Column({ type: 'boolean', nullable: true })
|
||||
enableSessionRebuild?: boolean;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at', type: 'timestamp' })
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp' })
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export default SystemConfig;
|
||||
Reference in New Issue
Block a user