This project is archived and is in readonly mode.

#2872 incomplete
Andrey "Zed" Zaikin

sqlite3 adapter drops :decimal columns precision & scale when migration tries to alter them

Reported by Andrey "Zed" Zaikin | July 6th, 2009 @ 10:42 AM | in 3.0.6

example migrations:

class M1 < ActiveRecord::Migration
  def self.up

create_table 'users' do |t|
  t.string 'name'
  t.decimal 'v1', :precision =&gt; 10, :scale =&gt; 3
end



end
def self.down
drop_table 'users'



end end
class M2 < ActiveRecord::Migration def self.up
change_column :users, :v1, :decimal, :precision =&gt; 12, :scale =&gt; 5



end
def self.down end end

expected resulting schema:

ActiveRecord::Schema.define(:version => 20090706090649) do
  create_table "users", :force => true do |t|

t.string  &quot;name&quot;
t.decimal &quot;v1&quot;,   :precision =&gt; 12, :scale =&gt; 5



end end

actual resulting schema:

ActiveRecord::Schema.define(:version => 20090706090649) do
  create_table "users", :force => true do |t|

t.string  &quot;name&quot;
t.decimal &quot;v1&quot;



end end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Pages