WRSC / tracking

WRSC boat tracking system with web dashboard
Other
13 stars 7 forks source link

Error during migration #50

Open tsaoyu opened 5 years ago

tsaoyu commented 5 years ago

@takluyver I saw some changes from last year in db/migration.

The migration file https://github.com/WRSC/tracking/blob/master/MYR_rails/db/migrate/201809122145_change_string_to_datetime.rb and https://github.com/WRSC/tracking/blob/master/MYR_rails/db/migrate/201809122251_change_coordinate_data_to_float.rb cause some error when I try to setup a server for this year's competition.

Could not find table 'coordinates'
/root/tracking/MYR_rails/db/migrate/201809122145_change_string_to_datetime.rb:3:in `up'
/root/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/root/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: Could not find table 'coordinates'
/root/tracking/MYR_rails/db/migrate/201809122145_change_string_to_datetime.rb:3:in `up'
/root/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/root/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate

Do you still remember what those migrations do?

takluyver commented 5 years ago

I think that is one I added, so sorry if I've broken something. I'm a bit unsure about the whole collection of migrations - I don't know that we need to keep them when we're creating a new database each year. But I'm not quite confident enough in that to delete them all. See #45.

tsaoyu commented 5 years ago

No worries. I found that it is possible to load all migrations from the db/schema.rb and it works well so far. I suspect that this is due to some migrates have been saved. But in the worst case, I still have a copy of production database in hand.