Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Startup script does not always perform migrations #2246

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ development:
password: changeme
database: lago
port: 5432
schema_search_path: "public"
events:
<<: *default
host: db
Expand Down Expand Up @@ -73,6 +74,7 @@ production:
url: <%= ENV['DATABASE_URL'] %>
pool: <%= ENV.fetch('DATABASE_POOL', 10) %>
prepared_statements: <%= ENV.fetch('DATABASE_PREPARED_STATEMENTS', true) %>
schema_search_path: <%= ENV.fetch('POSTGRES_SCHEMA', 'public') %>
events:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
Expand Down
4 changes: 3 additions & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ then
fi

rm -f ./tmp/pids/server.pid
bundle exec rails db:migrate:primary

if [ -v LAGO_CLICKHOUSE_ENABLED ] && [ "$LAGO_CLICKHOUSE_ENABLED" == "true" ]
then
bundle exec rails db:migrate:primary
bundle exec rake db:migrate:clickhouse
else
bundle exec rails db:migrate
fi

bundle exec rails signup:seed_organization
Expand Down