Last active
November 9, 2017 03:07
-
-
Save bibliotechy/9def061b82b6f34daded219a1a30087e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Y ou could write this | |
bin/rails generate migration CreateComponentsTable name:string local_id:string description_en:text description_jp:text | |
# and do so for all the fields outlined in the issue | |
# then do the same for Artist | |
bin/rails generate migration CreateArtistsTable name_en:string name_jp:string local_id:string viaf_id:string | |
# There a few fields that are references to another field. Like The user who created a component of a work. | |
# To add a reference to another Model, like Artist in Component | |
bin/rails generate migration AddArtistRefToComponents artist:references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateComponentsTable < ActiveRecord::Migration[5.0] | |
def change | |
create_table :components do |t| | |
t.string :name | |
t.string :local_id | |
t.text :description_en | |
t.text :description_jp | |
# ... | |
t.timestamps | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment