<commit_before>require 'lib/migrate'

class CreateOsmDb < ActiveRecord::Migration
  def self.up
    create_table "current_nodes", innodb_table do |t|
      t.column "id",        :bigint,   :limit => 64,                 :null => false
      t.column "latitude",  :double
      t.column "longitude", :double
      t.column "user_id",   :bigint,   :limit => 20
      t.column "visible",   :boolean
      t.column "tags",      :text,                   :default => "", :null => false
      t.column "timestamp", :datetime
    end

    add_index "current_nodes", ["id"], :name => "current_nodes_id_idx"
    add_index "current_nodes", ["latitude", "longitude"], :name => "current_nodes_lat_lon_idx"
    add_index "current_nodes", ["timestamp"], :name => "current_nodes_timestamp_idx"

    change_column "current_nodes", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "current_segments", innodb_table do |t|
      t.column "id",        :bigint,   :limit => 64,                 :null => false
      t.column "node_a",    :bigint,   :limit => 64
      t.column "node_b",    :bigint,   :limit => 64
      t.column "user_id",   :bigint,   :limit => 20
      t.column "visible",   :boolean
      t.column "tags",      :text,                   :default => "", :null => false
      t.column "timestamp", :datetime
    end

    add_index "current_segments", ["id", "visible"], :name => "current_segments_id_visible_idx"
    add_index "current_segments", ["node_a"], :name => "current_segments_a_idx"
    add_index "current_segments", ["node_b"], :name => "current_segments_b_idx"

    change_column "current_segments", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "current_way_segments", innodb_table do |t|
      t.column "id",          :bigint, :limit => 64
      t.column "segment_id",  :bigint, :limit => 11
      t.column "sequence_id", :bigint, :limit => 11
    end

    add_index "current_way_segments", ["segment_id"], :name => "current_way_segments_seg_idx"
    add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"

    create_table "current_way_tags", myisam_table do |t|
      t.column "id", :bigint, :limit => 64
      t.column "k",  :string,                :default => "", :null => false
      t.column "v",  :string,                :default => "", :null => false
    end

    add_index "current_way_tags", ["id"], :name => "current_way_tags_id_idx"
    execute "CREATE FULLTEXT INDEX `current_way_tags_v_idx` ON `current_way_tags` (`v`)"

    create_table "current_ways", myisam_table do |t|
      t.column "id",        :bigint,   :limit => 64, :null => false
      t.column "user_id",   :bigint,   :limit => 20
      t.column "timestamp", :datetime
      t.column "visible",   :boolean
    end

    add_primary_key "current_ways", ["id"]

    change_column "current_ways", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "diary_entries", myisam_table do |t|
      t.column "id",         :bigint,   :limit => 20, :null => false
      t.column "user_id",    :bigint,   :limit => 20, :null => false
      t.column "title",      :string
      t.column "body",       :text
      t.column "created_at", :datetime
      t.column "updated_at", :datetime
    end

    add_primary_key "diary_entries", ["id"]

    change_column "diary_entries", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "friends", myisam_table do |t|
      t.column "id",             :bigint,  :limit => 20, :null => false
      t.column "user_id",        :bigint,  :limit => 20, :null => false
      t.column "friend_user_id", :bigint,  :limit => 20, :null => false
    end

    add_primary_key "friends", ["id"]
    add_index "friends", ["friend_user_id"], :name => "user_id_idx"

    change_column "friends", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "gps_points", myisam_table do |t|
      t.column "altitude",  :float
      t.column "user_id",   :integer,  :limit => 20
      t.column "trackid",   :integer
      t.column "latitude",  :integer
      t.column "longitude", :integer
      t.column "gpx_id",    :integer,  :limit => 20
      t.column "timestamp", :datetime
    end

    add_index "gps_points", ["latitude", "longitude", "user_id"], :name => "points_idx"
    add_index "gps_points", ["user_id"], :name => "points_uid_idx"
    add_index "gps_points", ["gpx_id"], :name => "points_gpxid_idx"

    create_table "gpx_file_tags", myisam_table do |t|
      t.column "gpx_id", :bigint,  :limit => 64, :default => 0, :null => false
      t.column "tag",    :string
      t.column "id",     :integer, :limit => 20, :null => false
    end

    add_primary_key "gpx_file_tags", ["id"]
    add_index "gpx_file_tags", ["gpx_id"], :name => "gpx_file_tags_gpxid_idx"

    change_column "gpx_file_tags", "id", :integer, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "gpx_files", myisam_table do |t|
      t.column "id",          :bigint,   :limit => 64,                   :null => false
      t.column "user_id",     :bigint,   :limit => 20
      t.column "visible",     :boolean,                :default => true, :null => false
      t.column "name",        :string,                 :default => "",   :null => false
      t.column "size",        :bigint,   :limit => 20
      t.column "latitude",    :double
      t.column "longitude",   :double
      t.column "timestamp",   :datetime
      t.column "public",      :boolean,                :default => true, :null => false
      t.column "description", :string,                 :default => ""
      t.column "inserted",    :boolean
    end

    add_primary_key "gpx_files", ["id"]
    add_index "gpx_files", ["timestamp"], :name => "gpx_files_timestamp_idx"
    add_index "gpx_files", ["visible", "public"], :name => "gpx_files_visible_public_idx"

    change_column "gpx_files", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "gpx_pending_files", myisam_table do |t|
      t.column "originalname", :string
      t.column "tmpname",      :string
      t.column "user_id",      :bigint,  :limit => 20<commit_msg>Minor fix (integer => bigint) to one of the migrations so that they will run fully again.<commit_after>require 'lib/migrate'

class CreateOsmDb < ActiveRecord::Migration
  def self.up
    create_table "current_nodes", innodb_table do |t|
      t.column "id",        :bigint,   :limit => 64,                 :null => false
      t.column "latitude",  :double
      t.column "longitude", :double
      t.column "user_id",   :bigint,   :limit => 20
      t.column "visible",   :boolean
      t.column "tags",      :text,                   :default => "", :null => false
      t.column "timestamp", :datetime
    end

    add_index "current_nodes", ["id"], :name => "current_nodes_id_idx"
    add_index "current_nodes", ["latitude", "longitude"], :name => "current_nodes_lat_lon_idx"
    add_index "current_nodes", ["timestamp"], :name => "current_nodes_timestamp_idx"

    change_column "current_nodes", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "current_segments", innodb_table do |t|
      t.column "id",        :bigint,   :limit => 64,                 :null => false
      t.column "node_a",    :bigint,   :limit => 64
      t.column "node_b",    :bigint,   :limit => 64
      t.column "user_id",   :bigint,   :limit => 20
      t.column "visible",   :boolean
      t.column "tags",      :text,                   :default => "", :null => false
      t.column "timestamp", :datetime
    end

    add_index "current_segments", ["id", "visible"], :name => "current_segments_id_visible_idx"
    add_index "current_segments", ["node_a"], :name => "current_segments_a_idx"
    add_index "current_segments", ["node_b"], :name => "current_segments_b_idx"

    change_column "current_segments", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "current_way_segments", innodb_table do |t|
      t.column "id",          :bigint, :limit => 64
      t.column "segment_id",  :bigint, :limit => 11
      t.column "sequence_id", :bigint, :limit => 11
    end

    add_index "current_way_segments", ["segment_id"], :name => "current_way_segments_seg_idx"
    add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"

    create_table "current_way_tags", myisam_table do |t|
      t.column "id", :bigint, :limit => 64
      t.column "k",  :string,                :default => "", :null => false
      t.column "v",  :string,                :default => "", :null => false
    end

    add_index "current_way_tags", ["id"], :name => "current_way_tags_id_idx"
    execute "CREATE FULLTEXT INDEX `current_way_tags_v_idx` ON `current_way_tags` (`v`)"

    create_table "current_ways", myisam_table do |t|
      t.column "id",        :bigint,   :limit => 64, :null => false
      t.column "user_id",   :bigint,   :limit => 20
      t.column "timestamp", :datetime
      t.column "visible",   :boolean
    end

    add_primary_key "current_ways", ["id"]

    change_column "current_ways", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "diary_entries", myisam_table do |t|
      t.column "id",         :bigint,   :limit => 20, :null => false
      t.column "user_id",    :bigint,   :limit => 20, :null => false
      t.column "title",      :string
      t.column "body",       :text
      t.column "created_at", :datetime
      t.column "updated_at", :datetime
    end

    add_primary_key "diary_entries", ["id"]

    change_column "diary_entries", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "friends", myisam_table do |t|
      t.column "id",             :bigint,  :limit => 20, :null => false
      t.column "user_id",        :bigint,  :limit => 20, :null => false
      t.column "friend_user_id", :bigint,  :limit => 20, :null => false
    end

    add_primary_key "friends", ["id"]
    add_index "friends", ["friend_user_id"], :name => "user_id_idx"

    change_column "friends", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "gps_points", myisam_table do |t|
      t.column "altitude",  :float
      t.column "user_id",   :integer,  :limit => 20
      t.column "trackid",   :integer
      t.column "latitude",  :integer
      t.column "longitude", :integer
      t.column "gpx_id",    :integer,  :limit => 20
      t.column "timestamp", :datetime
    end

    add_index "gps_points", ["latitude", "longitude", "user_id"], :name => "points_idx"
    add_index "gps_points", ["user_id"], :name => "points_uid_idx"
    add_index "gps_points", ["gpx_id"], :name => "points_gpxid_idx"

    create_table "gpx_file_tags", myisam_table do |t|
      t.column "gpx_id", :bigint,  :limit => 64, :default => 0, :null => false
      t.column "tag",    :string
      t.column "id",     :integer, :limit => 20, :null => false
    end

    add_primary_key "gpx_file_tags", ["id"]
    add_index "gpx_file_tags", ["gpx_id"], :name => "gpx_file_tags_gpxid_idx"

    change_column "gpx_file_tags", "id", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT"

    create_table "gpx_files", myisam_table do |t|
      t.column "id",          :bigint,   :limit => 64,                   :null => false
      t.column "user_id",     :bigint,   :limit => 20
      t.column "visible",     :boolean,                :default => true, :null => false
      t.column "name",        :string,                 :default => "",   :null => false
      t.column "size",        :bigint,   :limit => 20
      t.column "latitude",    :double
      t.column "longitude",   :double
      t.column "timestamp",   :datetime
      t.column "public",      :boolean,                :default => true, :null => false
      t.column "description", :string,                 :default => ""
      t.column "inserted",    :boolean
    end

    add_primary_key "gpx_files", ["id"]
    add_index "gpx_files", ["timestamp"], :name => "gpx_files_timestamp_idx"
    add_index "gpx_files", ["visible", "public"], :name => "gpx_files_visible_public_idx"

    change_column "gpx_files", "id", :bigint, :limit => 64, :null => false, :options => "AUTO_INCREMENT"

    create_table "gpx_pending_files", myisam_table do |t|
      t.column "originalname", :string
      t.column "tmpname",      :string
      t.column "user_id",      :bigint,  :limit => 20
{'fraction_non_alphanumeric': 0.15678336111772645, 'fraction_numerical': 0.010319917440660475, 'mean_word_length': 2.836175395858709, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 182, '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': '6864092', 'n_tokens_mistral': 4432, 'n_tokens_neox': 4236, 'n_words': 1052}