From ad46aa6aa5f5446d0725597dd30cbb3dece51625 Mon Sep 17 00:00:00 2001
From: Thu Trang Pham <thuutrangpham@gmail.com>
Date: Wed, 11 Mar 2015 16:03:08 -0400
Subject: [PATCH] mySQL require precision and scale set on decimal values

---
 test/db/migrate/001_create_test_schema.rb | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/test/db/migrate/001_create_test_schema.rb b/test/db/migrate/001_create_test_schema.rb
index 0ba509dc..aca50cff 100644
--- a/test/db/migrate/001_create_test_schema.rb
+++ b/test/db/migrate/001_create_test_schema.rb
@@ -8,8 +8,8 @@ class CreateTestSchema < ActiveRecord::Migration
       create_table table do |t|
         t.column :name, :string
         t.column :address, :string
-        t.column :latitude, :decimal
-        t.column :longitude, :decimal
+        t.column :latitude, :decimal, :precision => 16, :scale => 6
+        t.column :longitude, :decimal, :precision => 16, :scale => 6
       end
     end
 
@@ -21,8 +21,8 @@ class CreateTestSchema < ActiveRecord::Migration
       create_table table do |t|
         t.column :name, :string
         t.column :address, :string
-        t.column :latitude, :decimal
-        t.column :longitude, :decimal
+        t.column :latitude, :decimal, :precision => 16, :scale => 6
+        t.column :longitude, :decimal, :precision => 16, :scale => 6
         t.column :result_class, :string
       end
     end
@@ -30,24 +30,24 @@ class CreateTestSchema < ActiveRecord::Migration
     create_table :place_with_forward_and_reverse_geocodings do |t|
       t.column :name, :string
       t.column :location, :string
-      t.column :lat, :decimal
-      t.column :lon, :decimal
+      t.column :lat, :decimal, :precision => 16, :scale => 6
+      t.column :lon, :decimal, :precision => 16, :scale => 6
       t.column :address, :string
     end
 
     create_table :place_reverse_geocoded_with_custom_results_handlings do |t|
       t.column :name, :string
       t.column :address, :string
-      t.column :latitude, :decimal
-      t.column :longitude, :decimal
+      t.column :latitude, :decimal, :precision => 16, :scale => 6
+      t.column :longitude, :decimal, :precision => 16, :scale => 6
       t.column :country, :string
     end
 
     create_table :place_with_custom_results_handlings do |t|
       t.column :name, :string
       t.column :address, :string
-      t.column :latitude, :decimal
-      t.column :longitude, :decimal
+      t.column :latitude, :decimal, :precision => 16, :scale => 6
+      t.column :longitude, :decimal, :precision => 16, :scale => 6
       t.column :coords_string, :string
     end
   end
-- 
GitLab