This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2021-03-19 02:43:13 +01:00
|
|
|
# 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
|
|
|
|
|
2023-02-08 01:10:25 +01:00
|
|
|
original_load_schema.bind_call(self, db_config, *args)
|
2021-03-19 02:43:13 +01:00
|
|
|
|
|
|
|
Mastodon::Snowflake.ensure_id_sequences_exist
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|