Trains management CRUD issues solved

This commit is contained in:
hagiye
2026-06-05 21:07:04 +03:00
parent 9676a6bb56
commit dc42838a43
41 changed files with 2192 additions and 1830 deletions

View File

@@ -0,0 +1,27 @@
import { Client } from 'pg';
async function createSchema() {
const client = new Client({
host: 'localhost',
port: 5432,
user: 'postgres',
password: '',
database: 'edr_freight',
});
try {
console.log('Connecting to Postgres...');
await client.connect();
console.log('Creating schema freight if not exists...');
await client.query('CREATE SCHEMA IF NOT EXISTS freight');
console.log('Schema ensured.');
await client.end();
process.exit(0);
} catch (err) {
console.error('Failed to create schema:', err);
try { await client.end(); } catch {}
process.exit(1);
}
}
createSchema();