mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-23 07:14:10 +00:00
21 lines
503 B
Ruby
21 lines
503 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative '../mastodon/snowflake'
|
|
|
|
module ActiveRecord
|
|
module Tasks
|
|
module DatabaseTasks
|
|
original_load_schema = instance_method(:load_schema)
|
|
|
|
define_method(:load_schema) do |db_config, *args|
|
|
ActiveRecord::Base.establish_connection(db_config)
|
|
Mastodon::Snowflake.define_timestamp_id
|
|
|
|
original_load_schema.bind(self).call(db_config, *args)
|
|
|
|
Mastodon::Snowflake.ensure_id_sequences_exist
|
|
end
|
|
end
|
|
end
|
|
end
|