It appears that you cannot use migrations (out of the box) with mysql
4.0.16,
because when creating a table, the statement says “ENGINE=InnoDb”,
instead of
“TYPE=InnoDB”.
Looking at the source code for the adapter, this appears to be hard
coded. Is
there any supported way to make this work with older versions of MySQL?
It appears that you cannot use migrations (out of the box) with mysql 4.0.16,
because when creating a table, the statement says “ENGINE=InnoDb”, instead of
“TYPE=InnoDB”.
May have been different in the past, but on Edge Rails we say
“InnoDB”. So that should be fixed by the forthcoming Rails 1.1
release.
It appears that you cannot use migrations (out of the box) with mysql 4.0.16,
because when creating a table, the statement says “ENGINE=InnoDb”, instead of
“TYPE=InnoDB”.
Looking at the source code for the adapter, this appears to be hard coded. Is
there any supported way to make this work with older versions of MySQL?
David,
Try this:
create_table(:mytable, :options => ‘TYPE=InnoDB’) do |t|
t.column :name, :string, :limit => 50
end
One warning, however…The schema dumper may not honor this option when
it dumps
your table back out into schema.rb.
This doesn’t prevent you from using migrations, but you just need to be
mindful.
It appears that you cannot use migrations (out of the box) with mysql 4.0.16,
because when creating a table, the statement says “ENGINE=InnoDb”, instead of
“TYPE=InnoDB”.
Looking at the source code for the adapter, this appears to be hard coded. Is
there any supported way to make this work with older versions of MySQL?
I’ve got a standard file I include for this… Stick this in lib/, and
include it from environment.rb:
module ActiveRecord
module ConnectionAdapters
class MysqlAdapter
def create_table(name, options = {})
super(name, {:options => “TYPE=InnoDB”}.merge(options))
end
end
end
end
On Sunday 26 February 2006 08:47 pm, David Heinemeier H. wrote:
It appears that you cannot use migrations (out of the box) with mysql
4.0.16, because when creating a table, the statement says
“ENGINE=InnoDb”, instead of “TYPE=InnoDB”.
May have been different in the past, but on Edge Rails we say
“InnoDB”. So that should be fixed by the forthcoming Rails 1.1
release.
The problem is the use of ENGINE, instead of TYPE.
The problem is the use of ENGINE, instead of TYPE.
Are you sure? I went and looked at the create table syntax in the mysql
manuals for 5.0
and for “3.23, 4.0, 4.1”. In both it says “{ENGINE|TYPE} = engine_name”.
The problem is the use of ENGINE, instead of TYPE.
Are you sure? I went and looked at the create table syntax in the mysql
manuals for 5.0 and for “3.23, 4.0, 4.1”. In both it says “{ENGINE|TYPE}
= engine_name”.
It’s definitely a problem in 4.0, and definitely not in 4.1. The MySQL
manual has a really nasty habit of covering up 4.0’s differences (and
deficiencies).
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.