booleans are not stored in an agnostic format, so migrating from postgres to MySQL makes all your trues silently change to false (i.e. corrupts a bunch of your records) #6

Open
nruth opened this Issue Aug 17, 2010 · 1 comment

Projects

None yet

1 participant

@nruth
Collaborator
nruth commented Aug 17, 2010

for example:

fixture dumped from postgres:


position:
created_at: 2010-06-17 04:27:57.9236
answer_set_id: "8"
updated_at: 2010-06-17 04:31:48.801354
text: What is the average percentage of marks obtained by all the students in Maths?
enabled: t
id: "9"
solution: (89+92+76+62+75+95)/6 = 81.5
correct_answer_id: "32"
question_set_id: "4"

fixture dumped from mysql:


position:
created_at: 2010-06-17 04:27:57
answer_set_id: "8"
updated_at: 2010-06-17 04:31:48
text: What is the average percentage of marks obtained by all the students in Maths?
enabled: "0"
id: "9"

The guilty column in this case uses the NOT NULL constraint (:null => false in rails migration).

This is an issue with using rails fixtures outside of their intended use, not sure if it's fixable or worth fixing, but worth being aware of.

@nruth
Collaborator
nruth commented Aug 17, 2010

the use case being migrating like this:

with the postgres database hooked up in database.yml:
rake db:data:dump

with the mysql database hooked up in database.yml
rake db:schema:load
rake db:data:load

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment