anlek / mongify

Mongify allows you to map your data from a sql database and into a mongodb document database.
http://github.com/anlek/mongify
MIT License
317 stars 82 forks source link

Embed_in doesn't work #143

Closed jcheng418 closed 7 years ago

jcheng418 commented 7 years ago

Hi,

In this test, I'm trying embed lu_project and lu_owner into lu_object table with following translation.rb but it never succeeded. The process run fine without any error msg and I just couldn't get the embedded structure. Can you please advise what could be wrong in the translation.rb file.

Regards!

table "lu_object" do column "object_id", :integer column "object_guid", :string column "object_name", :string column "object_desc", :string column "object_location", :string column "creation_date", :date column "modification_date", :date column "creation_timestamp", :datetime column "modification_timestamp", :datetime column "project_id", :integer column "owner_id", :integer column "object_status_id", :integer column "object_type_id", :integer column "object_category_id", :integer end

table "lu_project" ,:embed_in => :"lu_object", :on => :project_id do column "project_id", :integer column "project_guid", :string column "project_name", :string column "project_desc", :string column "creation_timestamp", :datetime column "modification_timestamp", :datetime column "project_status", :string column "metadata_id", :integer end

table "lu_owner" ,:embed_in => :"lu_object", :on => :owner_id do column "owner_id", :integer column "owner_guid", :string column "owner_name", :string column "owner_login", :string column "creation_timestamp", :datetime column "modification_timestamp", :datetime column "owner_status", :string end

anlek commented 7 years ago

Hello @jcheng418, your key columns must be setup for Mongify to know which columns are primary keys. Please see the docs in regards to column types