Aspects imported correctly

This commit is contained in:
Raphael 2011-01-07 14:54:50 -08:00
parent 1187c13170
commit 62486a17b6
2 changed files with 1 additions and 2 deletions

View file

@ -66,7 +66,7 @@ module DataConversion
log "Importing aspects to main table..."
Aspect.connection.execute <<-SQL
INSERT INTO aspects
SELECT mongo_aspects.* from mongo_aspects
SELECT mongo_aspects.id, mongo_aspects.name, users.id, mongo_aspects.created_at, mongo_aspects.updated_at, mongo_aspects.mongo_id, mongo_aspects.user_mongo_id FROM mongo_aspects INNER JOIN users ON (users.mongo_id = mongo_aspects.user_mongo_id)
SQL
log "Imported #{Aspect.count} aspects."
end

View file

@ -68,7 +68,6 @@ describe DataConversion::ImportToMysql do
aspect.name.should == "generic"
aspect.mongo_id.should == "4d2657e9cc8cb46033000006"
aspect.user_mongo_id.should == "4d2657e9cc8cb46033000005"
aspect.user_id.should == User.where(:mongo_id => aspect.user_mongo_id)
end
it "sets the relation column" do
@migrator.process_raw_aspects