Last active
September 28, 2016 21:08
-
-
Save luciuschoi/09c983e8de70bd3c7b0acbe93bb3c674 to your computer and use it in GitHub Desktop.
Normalization of Club Model...
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
# clubs 테이블을 이와 같이 중복되는 부분을 sesons 테이블로 빼내고 club_seasons 라는 join 테이블 만들면 어떨까요? | |
create_table "clubs", force: :cascade do |t| | |
t.string "name" | |
t.text "description" | |
t.string "type" | |
t.string "image" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
t.integer "report_length_limit", default: 400 | |
t.integer "leader_id" | |
t.string "keyword" | |
t.string "facebook_url" | |
t.string "leader" | |
t.string "short_keyword" | |
t.text "leader_description" | |
end | |
create_table "seasons", force: :cascade do |t| | |
t.integer "name" | |
t.string "alias" | |
t.string "schedule" | |
t.date "started_at" | |
t.date "ended_at" | |
t.integer "status" | |
t.integer "max_number" | |
t.integer "price" | |
t.integer "place_id" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
end | |
create_table "club_seasons", force: :cascade do |t| | |
t.integer "club_id" # FK : belongs_to :clubs | |
t.integer "season_id" # FK : belong_to :seasons | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment