Skip to content

Commit

Permalink
Merge pull request #815 from bavix/db-cache
Browse files Browse the repository at this point in the history
add support database cache
  • Loading branch information
rez1dent3 authored Dec 13, 2023
2 parents 3fd65e4 + ac48fd0 commit 88a8bc8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/phpunits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
php-versions: [8.1, 8.2, 8.3]
databases: [testing, pgsql, mysql, mariadb]
caches: [array, redis, memcached]
caches: [array, redis, memcached, database]
locks: [redis, memcached]

services:
Expand Down
38 changes: 38 additions & 0 deletions tests/migrations/2023_12_13_190445_create_cache_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('cache', static function (Blueprint $table) {
$table->string('key')
->primary();
$table->mediumText('value');
$table->integer('expiration');
});

Schema::create('cache_locks', static function (Blueprint $table) {
$table->string('key')
->primary();
$table->string('owner');
$table->integer('expiration');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

0 comments on commit 88a8bc8

Please sign in to comment.