<commit_before>module DatastoreAdmin
  class ResetDatastore
    require 'singleton'

    def self.clear_enqueued_jobs
      # NOTE: this just clears the default queue
      Sidekiq::Queue.new.clear
    end

    def self.truncate_database
      # NOTE: don't truncate schema_migrations or spatial_ref_sys
      sql = "
        TRUNCATE changesets,
                 change_payloads,
                 current_operators,
                 current_operators_serving_stop,
                 current_routes,
                 current_routes_serving_stop,
                 current_stops,
                 current_schedule_stop_pairs,
                 old_schedule_stop_pairs,
                 feed_imports,
                 feeds,
                 entities_imported_from_feed,
                 old_operators,
                 old_operators_serving_stop,
                 old_routes,
                 old_routes_serving_stop,
                 old_stops;

        ALTER SEQUENCE changesets_id_seq RESTART;
        ALTER SEQUENCE change_payloads_id_seq RESTART;
        ALTER SEQUENCE current_operators_id_seq RESTART;
        ALTER SEQUENCE current_operators_serving_stop_id_seq RESTART;
        ALTER SEQUENCE current_routes_id_seq RESTART;
        ALTER SEQUENCE current_routes_serving_stop_id_seq RESTART;
        ALTER SEQUENCE current_stops_id_seq RESTART;
        ALTER SEQUENCE current_schedule_stop_pairs_id_seq RESTART;
        ALTER SEQUENCE feed_imports_id_seq RESTART;
        ALTER SEQUENCE feeds_id_seq RESTART;
        ALTER SEQUENCE entities_imported_from_feed_id_seq RESTART;<commit_msg>updating admin reset to handle Feed Registry unmoring<commit_after>module DatastoreAdmin
  class ResetDatastore
    require 'singleton'

    def self.clear_enqueued_jobs
      # NOTE: this just clears the default queue
      Sidekiq::Queue.new.clear
    end

    def self.truncate_database
      # NOTE: don't truncate schema_migrations or spatial_ref_sys
      sql = "
        TRUNCATE changesets,
                 change_payloads,
                 current_feeds,
                 current_operators,
                 current_operators_serving_stop,
                 current_routes,
                 current_routes_serving_stop,
                 current_stops,
                 current_schedule_stop_pairs,
                 old_schedule_stop_pairs,
                 feed_imports,
                 entities_imported_from_feed,
                 old_feeds,
                 old_operators,
                 old_operators_serving_stop,
                 old_routes,
                 old_routes_serving_stop,
                 old_stops;

        ALTER SEQUENCE changesets_id_seq RESTART;
        ALTER SEQUENCE change_payloads_id_seq RESTART;
        ALTER SEQUENCE current_feeds_id_seq RESTART;
        ALTER SEQUENCE current_operators_id_seq RESTART;
        ALTER SEQUENCE current_operators_serving_stop_id_seq RESTART;
        ALTER SEQUENCE current_routes_id_seq RESTART;
        ALTER SEQUENCE current_routes_serving_stop_id_seq RESTART;
        ALTER SEQUENCE current_stops_id_seq RESTART;
        ALTER SEQUENCE current_schedule_stop_pairs_id_seq RESTART;
        ALTER SEQUENCE feed_imports_id_seq RESTART;
        ALTER SEQUENCE entities_imported_from_feed_id_seq RESTART;
        ALTER SEQUENCE old_feeds_id_seq RESTART;
{'fraction_non_alphanumeric': 0.028355957767722473, 'fraction_numerical': 0.0, 'mean_word_length': 2.146110056925996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '374621', 'n_tokens_mistral': 986, 'n_tokens_neox': 948, 'n_words': 187}