質問編集履歴
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -118,6 +118,34 @@
|
|
118
118
|
|
119
119
|
```
|
120
120
|
|
121
|
+
/sample_app/db/migrate/20180222080918_create_posts.rb
|
122
|
+
|
123
|
+
```Ruby
|
124
|
+
|
125
|
+
class CreatePosts < ActiveRecord::Migration[5.1]
|
126
|
+
|
127
|
+
def change
|
128
|
+
|
129
|
+
create_table :posts do |t|
|
130
|
+
|
131
|
+
# 以下の2行を追加
|
132
|
+
|
133
|
+
t.string :title
|
134
|
+
|
135
|
+
t.string :body
|
136
|
+
|
137
|
+
t.timestamps
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
```
|
146
|
+
|
147
|
+
|
148
|
+
|
121
149
|
|
122
150
|
|
123
151
|
|