Skip to content

Commit ceba3fa

Browse files
committed
Use anonymous migrations
1 parent a4b06ba commit ceba3fa

5 files changed

+10
-10
lines changed

database/migrations/2018_02_13_204645_create_urls_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
class CreateUrlsTable extends Migration
7+
return new class extends Migration
88
{
99
/**
1010
* Run the migrations.
@@ -30,4 +30,4 @@ public function down()
3030
{
3131
Schema::drop('shorturl_urls');
3232
}
33-
}
33+
};

database/migrations/2018_03_22_160425_add_counter_to_urls.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Support\Facades\Schema;
55

6-
class AddCounterToUrls extends Migration
6+
return new class extends Migration
77
{
88
/**
99
* Run the migrations.
@@ -16,4 +16,4 @@ public function up()
1616
$table->unsignedInteger('counter')->default(0)->after('code');
1717
});
1818
}
19-
}
19+
};

database/migrations/2018_04_23_160425_add_title_and_description_to_urls.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Support\Facades\Schema;
55

6-
class AddTitleAndDescriptionToUrls extends Migration
6+
return new class extends Migration
77
{
88
/**
99
* Run the migrations.
@@ -17,4 +17,4 @@ public function up()
1717
$table->text('description')->nullable()->after('title');
1818
});
1919
}
20-
}
20+
};

database/migrations/2019_09_06_231356_add_expires_at_to_urls.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Support\Facades\Schema;
55

6-
class AddExpiresAtToUrls extends Migration
6+
return new class extends Migration
77
{
88
/**
99
* Run the migrations.
@@ -16,4 +16,4 @@ public function up()
1616
$table->dateTime('expires_at')->nullable()->after('counter');
1717
});
1818
}
19-
}
19+
};

database/migrations/2020_03_04_214540_add_user_id_to_urls.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
class AddUserIdToUrls extends Migration
7+
return new class extends Migration
88
{
99
/**
1010
* Run the migrations.
@@ -18,4 +18,4 @@ public function up()
1818
$table->foreign('user_id')->references('id')->on('users');
1919
});
2020
}
21-
}
21+
};

0 commit comments

Comments
 (0)