質問編集履歴

2

2021/07/16 14:12

投稿

yukawa_
yukawa_

スコア13

test CHANGED
File without changes
test CHANGED
@@ -199,11 +199,3 @@
199
199
  }
200
200
 
201
201
  }
202
-
203
-
204
-
205
-
206
-
207
- コード
208
-
209
- ```

1

migration file を追加いたしました!

2021/07/16 14:12

投稿

yukawa_
yukawa_

スコア13

test CHANGED
File without changes
test CHANGED
@@ -129,3 +129,81 @@
129
129
  @endforeach
130
130
 
131
131
  ```
132
+
133
+ Migration File
134
+
135
+ ```php
136
+
137
+ <?php
138
+
139
+
140
+
141
+ use Illuminate\Support\Facades\Schema;
142
+
143
+ use Illuminate\Database\Schema\Blueprint;
144
+
145
+ use Illuminate\Database\Migrations\Migration;
146
+
147
+
148
+
149
+ class CreateFollowsTable extends Migration
150
+
151
+ {
152
+
153
+ /**
154
+
155
+ * Run the migrations.
156
+
157
+ *
158
+
159
+ * @return void
160
+
161
+ */
162
+
163
+ public function up()
164
+
165
+ {
166
+
167
+ Schema::create('follows', function (Blueprint $table) {
168
+
169
+ $table->increments('id')->autoIncrement();
170
+
171
+ $table->integer('follow_id');
172
+
173
+ $table->integer('follower_id');
174
+
175
+ $table->timestamp('created_at')->useCurrent();
176
+
177
+ });
178
+
179
+ }
180
+
181
+
182
+
183
+ /**
184
+
185
+ * Reverse the migrations.
186
+
187
+ *
188
+
189
+ * @return void
190
+
191
+ */
192
+
193
+ public function down()
194
+
195
+ {
196
+
197
+ Schema::dropIfExists('follows');
198
+
199
+ }
200
+
201
+ }
202
+
203
+
204
+
205
+
206
+
207
+ コード
208
+
209
+ ```