Skip to content

Commit a4fc2d2

Browse files
committed
Create prefectures table
1 parent 346005a commit a4fc2d2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CreatePrefectures < ActiveRecord::Migration[5.1]
2+
def change
3+
create_table :prefectures do |t|
4+
t.string :name
5+
t.string :region
6+
7+
t.index :name, unique: true
8+
t.index :region
9+
end
10+
end
11+
end

db/schema.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20170820090605) do
13+
ActiveRecord::Schema.define(version: 20171103041252) do
1414

1515
create_table "dojo_event_services", force: :cascade do |t|
1616
t.integer "dojo_id", null: false
@@ -50,4 +50,11 @@
5050
t.index ["service_name", "event_id"], name: "index_event_histories_on_service_name_and_event_id", unique: true
5151
end
5252

53+
create_table "prefectures", force: :cascade do |t|
54+
t.string "name"
55+
t.string "region"
56+
t.index ["name"], name: "index_prefectures_on_name", unique: true
57+
t.index ["region"], name: "index_prefectures_on_region"
58+
end
59+
5360
end

0 commit comments

Comments
 (0)