ekoetki/database/connection.js

17 lines
350 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const knex = require("knex");
const config = require("../config.json");
const DB = knex(config.database);
module.exports = DB;
process.nextTick(async ()=>{
try{
await DB.migrate.latest();
console.log("✅ Veritabanı tabloları kontrol edildi");
}catch(err){
console.error("❌ Migration hatası:", err);
}
})