Last active
September 16, 2021 22:02
-
-
Save tdubs42/655ab37705889cf8f37d3e54184902dc to your computer and use it in GitHub Desktop.
baseline for knex config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sharedConfig = { | |
client: 'sqlite3', | |
useNullAsDefault: true, | |
migrations: { | |
directory: './data/migrations', | |
}, | |
seeds: { | |
directory: './data/seeds', | |
}, | |
pool: { | |
afterCreate: (conn, done) => { | |
conn.run('PRAGMA foreign_keys = ON', done) | |
}, | |
}, | |
} | |
module.exports = { | |
development: { | |
...sharedConfig, | |
connection: { filename: './data/dev.db3' }, | |
}, | |
testing: { | |
...sharedConfig, | |
connection: { filename: './data/test.db3' }, | |
}, | |
production: { | |
...sharedConfig, | |
connection: { filename: './data/prod.db3' }, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment