ethermap/knexfile.js

74 lines
1.6 KiB
JavaScript
Raw Normal View History

// Update with your config settings.
import 'dotenv/config'
import { dirname } from 'path'
import { fileURLToPath } from 'url'
const __dirname = dirname(fileURLToPath(import.meta.url))
/**
* @type { Object.<string, import("knex").Knex.Config> }
*/
export default {
development: {
client: 'sqlite3',
useNullAsDefault: true,
connection: {
filename: __dirname + '/backend/db/development.db'
},
migrations: {
directory: __dirname + '/backend/db/migrations'
},
seeds: {
directory: __dirname + '/db/seeds'
}
},
test: {
client: 'sqlite3',
connection: ':memory:',
useNullAsDefault: true,
migrations: {
directory: __dirname + '/backend/db/migrations'
},
seeds: {
directory: __dirname + '/backend/db/seeds'
}
},
staging: {
client: process.env.DB_PROVIDER,
connection: {
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASS,
host: process.env.DB_HOST,
port: process.env.DB_PORT
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
production: {
client: process.env.DB_PROVIDER,
connection: {
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASS,
host: process.env.DB_HOST,
port: process.env.DB_PORT
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}
}