Merge pull request #1760 from basecamp/flavorjones/fix-setup-sqlite

Make sure the sqlite db is prepared in SAAS mode
This commit is contained in:
Mike Dalessio
2025-11-29 14:13:17 -05:00
committed by GitHub
2 changed files with 8 additions and 3 deletions
+7
View File
@@ -65,6 +65,13 @@ setup_database() {
local label="${adapter:+ ($adapter)}"
local env_cmd="${adapter:+env DATABASE_ADAPTER=$adapter}"
# When setting up sqlite in SAAS mode, we need to disable SAAS so that
# database.yml will use database.sqlite.yml instead of the fizzy-saas config.
# We also unset BUNDLE_GEMFILE so the standard Gemfile is used (without fizzy-saas).
if [ -n "$SAAS" ] && [ "$adapter" = "sqlite" ]; then
env_cmd="env DATABASE_ADAPTER=$adapter SAAS=false BUNDLE_GEMFILE="
fi
if [ "$reset" = "true" ]; then
step "Resetting the database$label" $env_cmd rails db:reset
else
+1 -3
View File
@@ -1,11 +1,9 @@
<%
require_relative "../lib/fizzy"
config_path = if Fizzy.saas?
gem_path = Gem::Specification.find_by_name("fizzy-saas").gem_dir
File.join(gem_path, "config", "database.yml")
else
File.join(__dir__, "database.#{Fizzy.db_adapter}.yml")
File.join("config", "database.#{Fizzy.db_adapter}.yml")
end
%>
<%= ERB.new(File.read(config_path)).result %>