Skip to content

Commit 88a8bc8

Browse files
authored
Merge pull request #815 from bavix/db-cache
add support database cache
2 parents 3fd65e4 + ac48fd0 commit 88a8bc8

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/phpunits.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
php-versions: [8.1, 8.2, 8.3]
2222
databases: [testing, pgsql, mysql, mariadb]
23-
caches: [array, redis, memcached]
23+
caches: [array, redis, memcached, database]
2424
locks: [redis, memcached]
2525

2626
services:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class() extends Migration {
10+
/**
11+
* Run the migrations.
12+
*/
13+
public function up(): void
14+
{
15+
Schema::create('cache', static function (Blueprint $table) {
16+
$table->string('key')
17+
->primary();
18+
$table->mediumText('value');
19+
$table->integer('expiration');
20+
});
21+
22+
Schema::create('cache_locks', static function (Blueprint $table) {
23+
$table->string('key')
24+
->primary();
25+
$table->string('owner');
26+
$table->integer('expiration');
27+
});
28+
}
29+
30+
/**
31+
* Reverse the migrations.
32+
*/
33+
public function down(): void
34+
{
35+
Schema::dropIfExists('cache');
36+
Schema::dropIfExists('cache_locks');
37+
}
38+
};

0 commit comments

Comments
 (0)