質問編集履歴

1

ソースコードの追加

2020/06/22 13:12

投稿

kamedamorio
kamedamorio

スコア6

test CHANGED
File without changes
test CHANGED
@@ -172,6 +172,86 @@
172
172
 
173
173
  ```
174
174
 
175
+ 2020_06_18_120744_create-table.php
176
+
177
+ ```php
178
+
179
+ <?php
180
+
181
+
182
+
183
+ use Illuminate\Support\Facades\Schema;
184
+
185
+ use Illuminate\Database\Schema\Blueprint;
186
+
187
+ use Illuminate\Database\Migrations\Migration;
188
+
189
+
190
+
191
+ class CreateTable extends Migration
192
+
193
+ {
194
+
195
+ /**
196
+
197
+ * Run the migrations.
198
+
199
+ *
200
+
201
+ * @return void
202
+
203
+ */
204
+
205
+ public function up()
206
+
207
+ {
208
+
209
+ //
210
+
211
+ Schema::create('user', function (Blueprint $table) {
212
+
213
+ $table->increments('id');
214
+
215
+ $table->string('name')->nullable();
216
+
217
+ $table->string('comment')->nullable();
218
+
219
+ $table->string('github_id');
220
+
221
+ $table->timestamps();
222
+
223
+ });
224
+
225
+ }
226
+
227
+
228
+
229
+ /**
230
+
231
+ * Reverse the migrations.
232
+
233
+ *
234
+
235
+ * @return void
236
+
237
+ */
238
+
239
+ public function down()
240
+
241
+ {
242
+
243
+ //
244
+
245
+ Schema::drop('user');
246
+
247
+ }
248
+
249
+ }
250
+
251
+ ```
252
+
253
+
254
+
175
255
 
176
256
 
177
257
  ### 試したこと