質問編集履歴

1

migrationファイルの追記

2017/10/22 07:07

投稿

you88
you88

スコア147

test CHANGED
File without changes
test CHANGED
@@ -163,3 +163,69 @@
163
163
 
164
164
 
165
165
  なんですがcommenttableが反映されないのとなぜかposttableも一部しか反映されず。。。
166
+
167
+
168
+
169
+ 20171022_追記
170
+
171
+
172
+
173
+ 下記のmigrationファイルが反映されていないです。開発環境だとされています。
174
+
175
+
176
+
177
+ ```
178
+
179
+ class RenameSexColumnToGender < ActiveRecord::Migration[5.1]
180
+
181
+ def change
182
+
183
+ rename_column :posts, :sex, :gender
184
+
185
+ end
186
+
187
+ end
188
+
189
+ ```
190
+
191
+
192
+
193
+ ```
194
+
195
+ class CreateComments < ActiveRecord::Migration[5.1]
196
+
197
+ def change
198
+
199
+ create_table :comments do |t|
200
+
201
+
202
+
203
+ t.timestamps
204
+
205
+ end
206
+
207
+ end
208
+
209
+ end
210
+
211
+ ```
212
+
213
+
214
+
215
+ ```
216
+
217
+ class Comments < ActiveRecord::Migration[5.1]
218
+
219
+ def change
220
+
221
+ add_column :comments, :comment, :text
222
+
223
+ add_column :comments, :user_id, :integer
224
+
225
+ add_column :comments, :post_id, :integer
226
+
227
+ end
228
+
229
+ end
230
+
231
+ ```