質問編集履歴
1
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -114,7 +114,31 @@
|
|
114
114
|
|
115
115
|
```
|
116
116
|
|
117
|
+
マイグレーション
|
117
118
|
|
119
|
+
```class CreateReplies < ActiveRecord::Migration[5.0]
|
120
|
+
|
121
|
+
def change
|
122
|
+
|
123
|
+
create_table :replies do |t|
|
124
|
+
|
125
|
+
t.references :user, foreign_key: true
|
126
|
+
|
127
|
+
t.references :micropost, foreign_key: true
|
128
|
+
|
129
|
+
t.string :content
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
t.timestamps
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
```
|
118
142
|
|
119
143
|
### 試したこと
|
120
144
|
|