From 23fd722471983b559d19d37a8d107e86a9b39d1f Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Wed, 13 Dec 2023 22:06:14 +0300 Subject: [PATCH 1/2] add support database cache --- .github/workflows/phpunits.yaml | 2 +- .../2023_12_13_190445_create_cache_table.php | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/migrations/2023_12_13_190445_create_cache_table.php diff --git a/.github/workflows/phpunits.yaml b/.github/workflows/phpunits.yaml index 1a8f57e73..7de2ac3c5 100644 --- a/.github/workflows/phpunits.yaml +++ b/.github/workflows/phpunits.yaml @@ -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: diff --git a/tests/migrations/2023_12_13_190445_create_cache_table.php b/tests/migrations/2023_12_13_190445_create_cache_table.php new file mode 100644 index 000000000..b9c106be8 --- /dev/null +++ b/tests/migrations/2023_12_13_190445_create_cache_table.php @@ -0,0 +1,35 @@ +string('key')->primary(); + $table->mediumText('value'); + $table->integer('expiration'); + }); + + Schema::create('cache_locks', 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'); + } +}; From ac48fd041faa033b3adc941dae57bdba20114c1b Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Wed, 13 Dec 2023 23:09:49 +0300 Subject: [PATCH 2/2] lintfix --- .../2023_12_13_190445_create_cache_table.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/migrations/2023_12_13_190445_create_cache_table.php b/tests/migrations/2023_12_13_190445_create_cache_table.php index b9c106be8..535685990 100644 --- a/tests/migrations/2023_12_13_190445_create_cache_table.php +++ b/tests/migrations/2023_12_13_190445_create_cache_table.php @@ -1,24 +1,27 @@ string('key')->primary(); + Schema::create('cache', static function (Blueprint $table) { + $table->string('key') + ->primary(); $table->mediumText('value'); $table->integer('expiration'); }); - Schema::create('cache_locks', function (Blueprint $table) { - $table->string('key')->primary(); + Schema::create('cache_locks', static function (Blueprint $table) { + $table->string('key') + ->primary(); $table->string('owner'); $table->integer('expiration'); });