modified: backend/src/controllers/databaseManagementController.ts
modified: backend/src/controllers/schemaController.ts modified: frontend/src/pages/DatabaseSchema.tsx
This commit is contained in:
@@ -2,6 +2,7 @@ import { Response } from 'express';
|
||||
import { AuthRequest } from '../middleware/auth';
|
||||
import { mainPool } from '../config/database';
|
||||
import { databasePoolManager } from '../services/DatabasePoolManager';
|
||||
import { generateSchemaForDatabase } from './schemaController';
|
||||
|
||||
// Только админы могут управлять базами данных
|
||||
export const getDatabases = async (req: AuthRequest, res: Response) => {
|
||||
@@ -92,6 +93,13 @@ export const createDatabase = async (req: AuthRequest, res: Response) => {
|
||||
// Добавить пул подключений (только для не-AQL баз)
|
||||
if (dbType !== 'aql') {
|
||||
await databasePoolManager.reloadPool(newDb.id);
|
||||
|
||||
// Generate schema in background for PostgreSQL databases
|
||||
if (dbType === 'postgresql') {
|
||||
generateSchemaForDatabase(newDb.id).catch(err => {
|
||||
console.error('Background schema generation failed:', err.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Не возвращаем пароль
|
||||
|
||||
Reference in New Issue
Block a user