n8n/packages/cli/src/databases/ormconfig.ts
Iván Ovejero b1e715299d
feat(core, editor): Support pairedItem for pinned data (#3843)
* 📘 Adjust interface

*  Adjust pindata in state store

*  Add utils

*  Replace utils calls

*  Adjust pindata intake and display

* 🔥 Remove excess BE fixes

* 📝 Update comment

* 🧪 Adjust tests

* 🔥 Remove unneeded helper

* 🚚 Improve naming

* 🧹 Clean up `ormconfig.ts`

* 📘 Add types and type guards

*  Improve serializer for sqlite

*  Create migration utils

*  Set up sqlite serializer

* 🗃️ Write sqlite migration

* 🗃️ Write MySQL migration

* 🗃️ Write Postgres migration

*  Add imports and exports to barrels

* 🚚 Rename `runChunked` to `runInBatches`

*  Improve migration loggers

* ♻️ Address feedback

* 🚚 Improve naming
2022-08-22 17:46:22 +02:00

71 lines
1.7 KiB
TypeScript

import path from 'path';
import { UserSettings } from 'n8n-core';
import { entities } from './entities';
const MIGRATIONS_DIR = path.resolve('src', 'databases', 'migrations');
const ENTITIES_DIR = path.resolve('src', 'databases', 'entities');
export default [
{
name: 'sqlite',
type: 'sqlite',
logging: true,
entities: Object.values(entities),
database: path.resolve(UserSettings.getUserN8nFolderPath(), 'database.sqlite'),
migrations: [path.resolve(MIGRATIONS_DIR, 'sqlite', 'index.ts')],
cli: {
entitiesDir: ENTITIES_DIR,
migrationsDir: path.resolve(MIGRATIONS_DIR, 'sqlite'),
},
},
{
name: 'postgres',
type: 'postgres',
database: 'n8n',
schema: 'public',
username: 'postgres',
password: '',
host: 'localhost',
port: 5432,
logging: false,
entities: Object.values(entities),
migrations: [path.resolve(MIGRATIONS_DIR, 'postgresdb', 'index.ts')],
cli: {
entitiesDir: ENTITIES_DIR,
migrationsDir: path.resolve(MIGRATIONS_DIR, 'postgresdb'),
},
},
{
name: 'mysql',
type: 'mysql',
database: 'n8n',
username: 'root',
password: 'password',
host: 'localhost',
port: 3306,
logging: false,
entities: Object.values(entities),
migrations: [path.resolve(MIGRATIONS_DIR, 'mysqldb', 'index.ts')],
cli: {
entitiesDir: ENTITIES_DIR,
migrationsDir: path.resolve(MIGRATIONS_DIR, 'mysqldb'),
},
},
{
name: 'mariadb',
type: 'mariadb',
database: 'n8n',
username: 'root',
password: 'password',
host: 'localhost',
port: 3306,
logging: false,
entities: Object.values(entities),
migrations: [path.resolve(MIGRATIONS_DIR, 'mysqldb', 'index.ts')],
cli: {
entitiesDir: ENTITIES_DIR,
migrationsDir: path.resolve(MIGRATIONS_DIR, 'mysqldb'),
},
},
];