Skip to content

Instantly share code, notes, and snippets.

@codeadict
Created July 21, 2015 15:07
Show Gist options
  • Save codeadict/b55d1b50a71752c86ded to your computer and use it in GitHub Desktop.
Save codeadict/b55d1b50a71752c86ded to your computer and use it in GitHub Desktop.
Importer Data structure
class DataImportTables < ActiveRecord::Migration
def change
create_table :imports do |t|
t.string :for_model, null: false, default: 'Properties'
t.string :name, null: false
t.attachment :file, null: false
t.references :company, null: false
t.timestamps null: false
end
create_table :import_mappings do |t|
t.references :import, null: false
t.string :excel_field, null: false
t.string :db_field
t.boolean :import_it, default: false
t.boolean :is_seach_key, default: false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment