Skip to content

Commit

Permalink
MIGRATION: Fix venues latitude/longitude on MySQL.
Browse files Browse the repository at this point in the history
Before, the schema used a default "decimal" column for these. Unfortunately,
MySQL interprets this as 10 digits, decimal and NO digits, which is crazy.

Now, the schema is 3 digits, decimal and 4 digits.
  • Loading branch information
igal committed Sep 1, 2012
1 parent 4ed4434 commit 3167001
Showing 1 changed file with 15 additions and 0 deletions.
@@ -0,0 +1,15 @@
class SpecifyVenuesLatitudeAndLongitudePrecision < ActiveRecord::Migration
FIELDS = %w[latitude longitude].map(&:to_sym)

def up
for field in FIELDS
change_column :venues, field, :decimal, :precision => 7, :scale => 4
end
end

def down
for field in FIELDS
change_column :venues, field, :decimal
end
end
end

0 comments on commit 3167001

Please sign in to comment.