Browse Source

Use bigIncrements for id column on migration stub

tags/1.3.1
Nafies Luthfi 7 years ago
parent
commit
e445fc866c
  1. 4
      src/stubs/database/migrations/migration-create.stub
  2. 4
      tests/Generators/MigrationGeneratorTest.php

4
src/stubs/database/migrations/migration-create.stub

@ -14,10 +14,10 @@ class CreateMastersTable extends Migration
public function up()
{
Schema::create('masters', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name', 60);
$table->string('description')->nullable();
$table->unsignedInteger('creator_id');
$table->unsignedBigInteger('creator_id');
$table->timestamps();
$table->foreign('creator_id')->references('id')->on('users')->onDelete('restrict');

4
tests/Generators/MigrationGeneratorTest.php

@ -29,10 +29,10 @@ class Create{$this->plural_model_name}Table extends Migration
public function up()
{
Schema::create('{$this->table_name}', function (Blueprint \$table) {
\$table->increments('id');
\$table->bigIncrements('id');
\$table->string('name', 60);
\$table->string('description')->nullable();
\$table->unsignedInteger('creator_id');
\$table->unsignedBigInteger('creator_id');
\$table->timestamps();
\$table->foreign('creator_id')->references('id')->on('users')->onDelete('restrict');

Loading…
Cancel
Save