質問編集履歴
3
ファイルパス、ファイル名追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -128,4 +128,6 @@
|
|
128
128
|
}
|
129
129
|
}
|
130
130
|
|
131
|
-
```
|
131
|
+
```
|
132
|
+
データベースファイル名はdatabase.sqliteです。
|
133
|
+
ファイルのパスは「C:\xampp\htdocs\laravelapp\database」です。
|
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -81,6 +81,16 @@
|
|
81
81
|
}
|
82
82
|
|
83
83
|
```
|
84
|
+
|
85
|
+
### 試したこと
|
86
|
+
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|
87
|
+
|
88
|
+
### 補足情報(FW/ツールのバージョンなど)
|
89
|
+
laravelのバージョンは5.8
|
90
|
+
phpは、7.3.1
|
91
|
+
OSはwindows10です
|
92
|
+
|
93
|
+
追記です
|
84
94
|
以下は、php artisan make:migration create_people_tableとし、作成したマイグレーションファイルになります。
|
85
95
|
```
|
86
96
|
<?php
|
@@ -118,11 +128,4 @@
|
|
118
128
|
}
|
119
129
|
}
|
120
130
|
|
121
|
-
```
|
131
|
+
```
|
122
|
-
### 試したこと
|
123
|
-
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|
124
|
-
|
125
|
-
### 補足情報(FW/ツールのバージョンなど)
|
126
|
-
laravelのバージョンは5.8
|
127
|
-
phpは、7.3.1
|
128
|
-
OSはwindows10です
|
1
ファイルの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -81,6 +81,44 @@
|
|
81
81
|
}
|
82
82
|
|
83
83
|
```
|
84
|
+
以下は、php artisan make:migration create_people_tableとし、作成したマイグレーションファイルになります。
|
85
|
+
```
|
86
|
+
<?php
|
87
|
+
|
88
|
+
use Illuminate\Support\Facades\Schema;
|
89
|
+
use Illuminate\Database\Schema\Blueprint;
|
90
|
+
use Illuminate\Database\Migrations\Migration;
|
91
|
+
|
92
|
+
class CreatePeopleTable extends Migration
|
93
|
+
{
|
94
|
+
/**
|
95
|
+
* Run the migrations.
|
96
|
+
*
|
97
|
+
* @return void
|
98
|
+
*/
|
99
|
+
public function up()
|
100
|
+
{
|
101
|
+
Schema::create('people', function (Blueprint $table) {
|
102
|
+
$table->increments('id');
|
103
|
+
$table->string('name');
|
104
|
+
$table->string('mail');
|
105
|
+
$table->integer('age');
|
106
|
+
$table->timestamps();
|
107
|
+
});
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Reverse the migrations.
|
112
|
+
*
|
113
|
+
* @return void
|
114
|
+
*/
|
115
|
+
public function down()
|
116
|
+
{
|
117
|
+
Schema::dropIfExists('people');
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
```
|
84
122
|
### 試したこと
|
85
123
|
エラー「 1 no such table:」と出ていたので、 select count(*) from sqlite_master where type='table' and name='people';とコマンドに打ち込んだのですが、「1」が返ってきた為、テーブルは存在しているものと思われます。
|
86
124
|
|