2019年5月20日月曜日

laravel table schema mapping

Auto-incrementing UNSIGNED BIGINT (primary key)  => $table->bigIncrements('id');
DATE  => $table->date('created_at');
DATETIME  => $table->dateTime('created_at');
VARCHAR  => $table->string('name', 100);
TEXT  => $table->text('description');
TIMESTAMP  => $table->timestamp('added_on');

Allows (by default) NULL values to be inserted into the column
->nullable($value = true)

Specify a "default" value for the column
->default($value)

Add a comment
->comment('my comment')

Set INTEGER columns as auto-increment (primary key)
->autoIncrement()

0 件のコメント:

コメントを投稿