teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

spotests のテーブル構成を追記

2021/05/14 10:53

投稿

TKHS8203
TKHS8203

スコア3

title CHANGED
File without changes
body CHANGED
@@ -70,6 +70,40 @@
70
70
  }
71
71
  ```
72
72
 
73
+ ```2021_05_10**_create_spotests_table.php
74
+ use Illuminate\Database\Migrations\Migration;
75
+ use Illuminate\Database\Schema\Blueprint;
76
+ use Illuminate\Support\Facades\Schema;
77
+
78
+ class CreateSpotestsTable extends Migration
79
+ {
80
+ /**
81
+ * Run the migrations.
82
+ *
83
+ * @return void
84
+ */
85
+ public function up()
86
+ {
87
+ Schema::create('spotests', function (Blueprint $table) {
88
+ $table->id();
89
+ $table->text('name');
90
+ $table->json('schedule');
91
+ $table->timestamps();
92
+ });
93
+ }
94
+
95
+ /**
96
+ * Reverse the migrations.
97
+ *
98
+ * @return void
99
+ */
100
+ public function down()
101
+ {
102
+ Schema::dropIfExists('spotests');
103
+ }
104
+ }
105
+ ```
106
+
73
107
  ### 試したこと
74
108
  エラーには Array to string conversion と出ているので、'schedule'の配列を文字列に変換できない事かと思い、
75
109
  database > migrations > 2021_05_10******_create_spotests_table.php 内のカラム型を変更してみましたが