Schema_migrations and schema_info


#1

i’m using Aptana Studio for developing my rails application, and it
generates migrations files with names like
20090107231713_name_of_migration. Sequence number of migration is
generated from current timestamp. In my development database i have
table SCHEMA_MIGRATIONS with varchar(255) field ‘version’. In this table
i have list of all applied migrations and everything goes fine. But in
my production database on webserver i don’t have SCHEMA_MIGRATIONS
table, i have SCHEMA_INFO instead. This table has field ‘version’ too,
but it’s integer. Also this table doesn’t seem to contain all the
applied migrations, only the last one. rake db:migrate tries to store in
this table value like 20090107231713 and failes, because it’s too big fo
integer.

The main question is: is SCHEMA_INFO designed to contain only number of
last applied migration o have i some nasty bug? Will it be allright if i
convert SCHEMA_INFO.version to varchar(255)?

Also maybe someone knows, how to override Aptana’s migration naming
rules to make them sequential like 00001_…, 00002_…?

thanks and sorry for my english =\


#2

Anton Anykeyev wrote:

i’m using Aptana Studio for developing my rails application, and it
generates migrations files with names like
20090107231713_name_of_migration. Sequence number of migration is
generated from current timestamp. In my development database i have
table SCHEMA_MIGRATIONS with varchar(255) field ‘version’. In this table
i have list of all applied migrations and everything goes fine. But in
my production database on webserver i don’t have SCHEMA_MIGRATIONS
table, i have SCHEMA_INFO instead. This table has field ‘version’ too,
but it’s integer. Also this table doesn’t seem to contain all the
applied migrations, only the last one. rake db:migrate tries to store in
this table value like 20090107231713 and failes, because it’s too big fo
integer.

The main question is: is SCHEMA_INFO designed to contain only number of
last applied migration o have i some nasty bug? Will it be allright if i
convert SCHEMA_INFO.version to varchar(255)?

Also maybe someone knows, how to override Aptana’s migration naming
rules to make them sequential like 00001_…, 00002_…?

thanks and sorry for my english =\

Seems like the migration is failing to update the database; SCHEMA_INFO
should automatically be replaced with SCHEMA_MIGRATIONS.

Does your webserver run the correct version of rails?

Looking at the migration docs
(http://api.rubyonrails.org/classes/ActiveRecord/Migration.html), it
shows that you can disable the datastamp migrations with:

config.active_record.timestamped_migrations = false

Hope that helps,
James.