Skip to content

Commit

Permalink
Copy three migrations over from admin repo
Browse files Browse the repository at this point in the history
Should fix issue on staging w/ missing geolocation readable_path
  • Loading branch information
dce committed Sep 19, 2017
1 parent e50933b commit 928825f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddReadablePathToGeolocations < ActiveRecord::Migration
def self.up
add_column :geolocations, :readable_path, :string
end

def self.down
remove_column :geolocations, :readable_path
end
end
9 changes: 9 additions & 0 deletions db/migrate/20170630144854_add_geolocation_indexes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddGeolocationIndexes < ActiveRecord::Migration
def self.up
add_index :geolocations, :readable_path
end

def self.down
remove_index :geolocations, :readable_path
end
end
15 changes: 15 additions & 0 deletions db/migrate/20170714154027_add_trigram_index_to_organizations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class AddTrigramIndexToOrganizations < ActiveRecord::Migration
def self.up
execute <<-SQL
create index index_organizations_on_name_trigram
on organizations
using gin(name gin_trgm_ops);
SQL
end

def self.down
execute <<-SQL
drop index 'index_organizations_on_name_trigram'
SQL
end
end

0 comments on commit 928825f

Please sign in to comment.