move establish_connection from database.yml to LegacyBase class