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