Skip to content

Commit 92264c2

Browse files
authored
Merge pull request #48 from balajidharma/2.x-Changes
Rename migration tables
2 parents 428a512 + 9aa9d99 commit 92264c2

7 files changed

+141
-140
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('users', function (Blueprint $table) {
15+
$table->id();
16+
$table->string('name');
17+
$table->string('email')->unique();
18+
$table->timestamp('email_verified_at')->nullable();
19+
$table->string('password');
20+
$table->rememberToken();
21+
$table->timestamps();
22+
});
23+
24+
Schema::create('password_reset_tokens', function (Blueprint $table) {
25+
$table->string('email')->primary();
26+
$table->string('token');
27+
$table->timestamp('created_at')->nullable();
28+
});
29+
30+
Schema::create('sessions', function (Blueprint $table) {
31+
$table->string('id')->primary();
32+
$table->foreignId('user_id')->nullable()->index();
33+
$table->string('ip_address', 45)->nullable();
34+
$table->text('user_agent')->nullable();
35+
$table->longText('payload');
36+
$table->integer('last_activity')->index();
37+
});
38+
}
39+
40+
/**
41+
* Reverse the migrations.
42+
*/
43+
public function down(): void
44+
{
45+
Schema::dropIfExists('users');
46+
Schema::dropIfExists('password_reset_tokens');
47+
Schema::dropIfExists('sessions');
48+
}
49+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('cache', function (Blueprint $table) {
15+
$table->string('key')->primary();
16+
$table->mediumText('value');
17+
$table->integer('expiration');
18+
});
19+
20+
Schema::create('cache_locks', function (Blueprint $table) {
21+
$table->string('key')->primary();
22+
$table->string('owner');
23+
$table->integer('expiration');
24+
});
25+
}
26+
27+
/**
28+
* Reverse the migrations.
29+
*/
30+
public function down(): void
31+
{
32+
Schema::dropIfExists('cache');
33+
Schema::dropIfExists('cache_locks');
34+
}
35+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('jobs', function (Blueprint $table) {
15+
$table->id();
16+
$table->string('queue')->index();
17+
$table->longText('payload');
18+
$table->unsignedTinyInteger('attempts');
19+
$table->unsignedInteger('reserved_at')->nullable();
20+
$table->unsignedInteger('available_at');
21+
$table->unsignedInteger('created_at');
22+
});
23+
24+
Schema::create('job_batches', function (Blueprint $table) {
25+
$table->string('id')->primary();
26+
$table->string('name');
27+
$table->integer('total_jobs');
28+
$table->integer('pending_jobs');
29+
$table->integer('failed_jobs');
30+
$table->longText('failed_job_ids');
31+
$table->mediumText('options')->nullable();
32+
$table->integer('cancelled_at')->nullable();
33+
$table->integer('created_at');
34+
$table->integer('finished_at')->nullable();
35+
});
36+
37+
Schema::create('failed_jobs', function (Blueprint $table) {
38+
$table->id();
39+
$table->string('uuid')->unique();
40+
$table->text('connection');
41+
$table->text('queue');
42+
$table->longText('payload');
43+
$table->longText('exception');
44+
$table->timestamp('failed_at')->useCurrent();
45+
});
46+
}
47+
48+
/**
49+
* Reverse the migrations.
50+
*/
51+
public function down(): void
52+
{
53+
Schema::dropIfExists('jobs');
54+
Schema::dropIfExists('job_batches');
55+
Schema::dropIfExists('failed_jobs');
56+
}
57+
};

database/migrations/2014_10_12_000000_create_users_table.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

database/migrations/2014_10_12_100000_create_password_resets_table.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

database/migrations/2019_08_19_000000_create_failed_jobs_table.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)