mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-13 14:02:23 +00:00
17 lines
374 B
Ruby
17 lines
374 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
namespace :db do
|
||
|
namespace :migrate do
|
||
|
desc 'Setup the db or migrate depending on state of db'
|
||
|
task setup: :environment do
|
||
|
begin
|
||
|
ActiveRecord::Base.connection
|
||
|
rescue ActiveRecord::NoDatabaseError
|
||
|
Rake::Task['db:setup'].invoke
|
||
|
else
|
||
|
Rake::Task['db:migrate'].invoke
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|