Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Explores issues with Scenic working with multiple database types

Notifications You must be signed in to change notification settings

mhw/scenic-multiple-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scenic - Multiple Database

This repository contains a basic Rails 6 app that combines multiple database configurations with the Scenic gem.

The repository includes branch heads at the following points:

  • pg-pg: On this branch the app is configured with two Postgres database connections, primary and legacy in database.yml. It also includes migrations that add tables and views to both of these databases. The current version of Scenic works correctly in this scenario. The migrations are in each connection's migrations_paths folder, and rake db:migrate correctly creates the views in the appropriate databases.

  • pg-mysql: On this branch the legacy database has been switched to MySQL. This causes Scenic to fail when the schema.rb file for the legacy database is being generated, even when it contains no views. I've filed a GitHub issue for this.

  • pg-mysql-fix: This branch adds an initializer that fixes the issue by choosing the correct Scenic adapter to match the database connection that is in use.

  • master: The master branch pulls these threads together: it uses the initializer to add the scenic-mysql_adapter to the app, and also includes the additional migrations from the pg-pg branch. The fix in the initializer makes Scenic switch between the two adapters as necessary to make rake db:migrate work.

About

Explores issues with Scenic working with multiple database types

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published