2023-09-13 16:59:17 +02:00
|
|
|
// 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: {
|
2023-09-14 12:50:31 +02:00
|
|
|
client: 'sqlite3',
|
2023-09-14 14:06:42 +02:00
|
|
|
useNullAsDefault: true,
|
2023-09-13 16:59:17 +02:00
|
|
|
connection: {
|
2023-09-14 14:06:42 +02:00
|
|
|
filename: __dirname + '/backend/db/development.db'
|
2023-09-14 12:50:31 +02:00
|
|
|
},
|
|
|
|
migrations: {
|
2023-09-14 14:06:42 +02:00
|
|
|
directory: __dirname + '/backend/db/migrations'
|
2023-09-14 12:50:31 +02:00
|
|
|
},
|
|
|
|
seeds: {
|
|
|
|
directory: __dirname + '/db/seeds'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
test: {
|
|
|
|
client: 'sqlite3',
|
2023-09-14 13:39:47 +02:00
|
|
|
connection: ':memory:',
|
2023-09-14 12:50:31 +02:00
|
|
|
useNullAsDefault: true,
|
2023-09-13 16:59:17 +02:00
|
|
|
migrations: {
|
2023-09-14 14:06:42 +02:00
|
|
|
directory: __dirname + '/backend/db/migrations'
|
2023-09-13 16:59:17 +02:00
|
|
|
},
|
|
|
|
seeds: {
|
2023-09-14 14:06:42 +02:00
|
|
|
directory: __dirname + '/backend/db/seeds'
|
2023-09-13 16:59:17 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
staging: {
|
2023-09-14 13:39:47 +02:00
|
|
|
client: process.env.DB_PROVIDER,
|
2023-09-13 16:59:17 +02:00
|
|
|
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: {
|
2023-09-14 13:39:47 +02:00
|
|
|
client: process.env.DB_PROVIDER,
|
2023-09-13 16:59:17 +02:00
|
|
|
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'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|