Automatically migrate database

This commit is contained in:
Omar Roth 2019-04-10 16:23:37 -05:00
parent b8c87632e6
commit 5dc45c35e6
5 changed files with 123 additions and 9 deletions

View file

@ -105,10 +105,16 @@ end
Kemal::CLI.new ARGV
# Check table integrity
analyze_table(PG_DB, logger, "channel_videos", ChannelVideo)
analyze_table(PG_DB, logger, "nonces", Nonce)
analyze_table(PG_DB, logger, "session_ids", SessionId)
analyze_table(PG_DB, logger, "users", User)
analyze_table(PG_DB, logger, "videos", Video)
# Start jobs
refresh_channels(PG_DB, logger, config.channel_threads, config.full_refresh)
refresh_feeds(PG_DB, logger, config.feed_threads)
subscribe_to_feeds(PG_DB, logger, HMAC_KEY, config)
statistics = {