public function up() {
Schema::create( 'active_stocks', function ( Blueprint $table ) {
$table->bigIncrements( 'id' );
$table->string( 'sku' );
$table->text( 'title' )->nullable()->default( '' );
$table->integer( 'cost' )->default(0);
$table->integer( 'qty' )->default(0);
$table->string( 'stock_tracking' )->default('')->nullable();
$table->integer( 'type' )->default(1);
$table->text( 'image' )->nullable();
$table->integer( 'user_id' );
$table->integer( 'status' )->default(1);
$table->timestamps();
} );
\Illuminate\Support\Facades\DB::statement( "ALTER TABLE `active_stocks` AUTO_INCREMENT = 9999999999;" );
}
我已将自动增量设置为我在开发中想要的某个值。然后我创建一个新记录使用拉拉维尔雄辩
$create = App/ActiveStock::create(
[
'sku' => $item_array['sku'],
'qty' => $item_array['qty'],
'stock_tracking' => $item_array['tracking'],
'type' => ActiveStock::TYPE_IMPORTED,
'cost' => $item_array['cost'],
'user_id' => $user_id,
]
)
echo $create->id; //Should be 9999999999
但我得到了这个但是我看了数据库的id值是正确的。21474836479999999999
我在这里错过了什么。
慕勒3428872
慕村9548890