Skip to content

Commit

Permalink
Migrate the database on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
xendk committed Jun 14, 2024
1 parent 46bcf9e commit f09b2a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/application.cr
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ require "../src/responses/**"
require "harvest"
require "cron_scheduler"
require "../src/sync"

# For migrating database.
require "micrate"
3 changes: 3 additions & 0 deletions src/combine.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
require "../config/application"

Micrate::DB.connection_url = Amber.settings.database_url
Micrate::Cli.run_up

def sync
harvest = Harvest.new(
Amber.settings.secrets["harvest_account_id"],
Expand Down

0 comments on commit f09b2a9

Please sign in to comment.