質問編集履歴
3
ファイルパス、ファイル名追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -259,3 +259,7 @@
|
|
259
259
|
|
260
260
|
|
261
261
|
```
|
262
|
+
|
263
|
+
データベースファイル名はdatabase.sqliteです。
|
264
|
+
|
265
|
+
ファイルのパスは「C:\xampp\htdocs\laravelapp\database」です。
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,6 +164,26 @@
|
|
164
164
|
|
165
165
|
```
|
166
166
|
|
167
|
+
|
168
|
+
|
169
|
+
### 試したこと
|
170
|
+
|
171
|
+
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
### 補足情報(FW/ツールのバージョンなど)
|
176
|
+
|
177
|
+
laravelのバージョンは5.8
|
178
|
+
|
179
|
+
phpは、7.3.1
|
180
|
+
|
181
|
+
OSはwindows10です
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
追記です
|
186
|
+
|
167
187
|
以下は、php artisan make:migration create_people_tableとし、作成したマイグレーションファイルになります。
|
168
188
|
|
169
189
|
```
|
@@ -239,17 +259,3 @@
|
|
239
259
|
|
240
260
|
|
241
261
|
```
|
242
|
-
|
243
|
-
### 試したこと
|
244
|
-
|
245
|
-
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
### 補足情報(FW/ツールのバージョンなど)
|
250
|
-
|
251
|
-
laravelのバージョンは5.8
|
252
|
-
|
253
|
-
phpは、7.3.1
|
254
|
-
|
255
|
-
OSはwindows10です
|
1
ファイルの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,6 +164,82 @@
|
|
164
164
|
|
165
165
|
```
|
166
166
|
|
167
|
+
以下は、php artisan make:migration create_people_tableとし、作成したマイグレーションファイルになります。
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
<?php
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
use Illuminate\Support\Facades\Schema;
|
176
|
+
|
177
|
+
use Illuminate\Database\Schema\Blueprint;
|
178
|
+
|
179
|
+
use Illuminate\Database\Migrations\Migration;
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
class CreatePeopleTable extends Migration
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
/**
|
188
|
+
|
189
|
+
* Run the migrations.
|
190
|
+
|
191
|
+
*
|
192
|
+
|
193
|
+
* @return void
|
194
|
+
|
195
|
+
*/
|
196
|
+
|
197
|
+
public function up()
|
198
|
+
|
199
|
+
{
|
200
|
+
|
201
|
+
Schema::create('people', function (Blueprint $table) {
|
202
|
+
|
203
|
+
$table->increments('id');
|
204
|
+
|
205
|
+
$table->string('name');
|
206
|
+
|
207
|
+
$table->string('mail');
|
208
|
+
|
209
|
+
$table->integer('age');
|
210
|
+
|
211
|
+
$table->timestamps();
|
212
|
+
|
213
|
+
});
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
/**
|
220
|
+
|
221
|
+
* Reverse the migrations.
|
222
|
+
|
223
|
+
*
|
224
|
+
|
225
|
+
* @return void
|
226
|
+
|
227
|
+
*/
|
228
|
+
|
229
|
+
public function down()
|
230
|
+
|
231
|
+
{
|
232
|
+
|
233
|
+
Schema::dropIfExists('people');
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
```
|
242
|
+
|
167
243
|
### 試したこと
|
168
244
|
|
169
245
|
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|