Laravel コピペリスト


Migrations

$table->tinyInteger(‘flag’)->default(0);
符号付きの範囲は -128 から 127(C# sbyte)。
$table->unsignedTinyInteger(‘flag’)->default(0);
符号なしの範囲は 0 から 255(C# byte)。

$table->smallInteger(‘votes’);
符号付きの範囲は -32768 から 32767(C# short)。
$table->unsignedSmallInteger(‘votes’);
符号なしの範囲は 0 から 65535 。(C# ushort)。

$table->unsignedMediumInteger(‘votes’);
符号付きの範囲は -8388608 から 8388607。
符号なしの範囲は 0 から 16777215。

$table->integer(‘votes’);
符号付きの範囲は -2147483648 から 2147483647(int)。
$table->unsignedInteger(‘votes’);
符号なしの範囲は 0 から 4294967295(uint)。

$table->bigInteger(‘votes’);
符号付きの範囲は -9223372036854775808 から 9223372036854775807(long)。
$table->unsignedBigInteger(”)->default(0);
符号なしの範囲は 0 から 18446744073709551615 (C#では ulong)。

$table->foreignId(‘user_id’)->constrained();

$table->string(‘name’)->nullable(true);

$table->dateTime(‘created_at’, $precision = 0);
$precision精度
$table->timestamp(‘created_at’)->default(DB::raw(‘CURRENT_TIMESTAMP’));
値のTIMESTAMP範囲は '1970-01-01 00:00:01' UTC'2038-01-19 03:14:07' UTCです。
$table->date(‘created_at’);


コメントは受け付けていません。