Hi All,
My application saves a file into the database as blob. I am creating the
database table using rake migrate.
In postgresql it is working fine with :bytea type and on MySQL it is
working fine with :blob
I do not want to manually make changes except in database.yml
Can anybody help me with writing a more useful rake migrate code whichn
is more portable?
Thanks in advance.
Regards,
Janeve
Sample code:
==================
For PostgreSQL:
class CreateActivities < ActiveRecord::Migration
def self.up
create_table :activities do |t|
t.column :a_file, :bytea
end
end
def self.down
drop_table :activities
end
End
==================
For MySql:
class CreateActivities < ActiveRecord::Migration
def self.up
create_table :activities do |t|
t.column :a_file, :bytea
end
end
def self.down
drop_table :activities
end
end