現在、laravel5.5を使ってテーブルを作成しようとしています。
リファレンスを見て、修飾子をつけていったのですがエラーで進みません。
user_id integer primary_key / auto_increment
name varchar(20) not null
pass varchar(20) not null
image_pass varchar(89) default('default')
birthday_year integer
birthday_month integer
birthday_day integer
gender_id char(1) not null
mail varchar(89) not null / unipue
このような形でテーブルを作成したいのですが
以下のコードをどのようにして変更すれば通ってくれるでしょうか?
また調べていると,nullの値を許容する修飾子はあったのですが
notnullの修飾子は見当たらなかったのですが、もしかしてlaravelでは元がnotnullなのですか?
よろしくお願いいたします。
Schema::create('users', function (Blueprint $table) { $table->integer('user_id'); $table->string('name', 20); $table->string('pass', 20); $table->string('image_pass', 89); $table->integer('birthday_year'); $table->integer('birthday_month'); $table->integer('birthday_day'); $table->integer('gender_id'); $table->string('mail', 89); $table->rememberToken(); $table->timestamps(); });
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/10/04 09:31
2017/10/04 09:39 編集
2017/10/11 04:00
2017/10/11 04:01