質問編集履歴
1
ReplyのDBを付け加えました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -267,3 +267,31 @@
|
|
267
267
|
end
|
268
268
|
|
269
269
|
```
|
270
|
+
|
271
|
+
class Reply のDBです
|
272
|
+
|
273
|
+
```Rails
|
274
|
+
|
275
|
+
class CreateReplies < ActiveRecord::Migration[5.2]
|
276
|
+
|
277
|
+
def change
|
278
|
+
|
279
|
+
create_table :replies do |t|
|
280
|
+
|
281
|
+
t.references :title, foreign_key: { to_table: :tasks }
|
282
|
+
|
283
|
+
t.references :user, foreign_key: true
|
284
|
+
|
285
|
+
t.string :comment
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
t.timestamps
|
290
|
+
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
end
|
296
|
+
|
297
|
+
```
|