0001_01_01_000001_create_cache_table.php 900 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. use App\Database\Migrations\MasterMigration;
  6. return new class extends MasterMigration
  7. {
  8. /**
  9. * Run the migrations.
  10. */
  11. public function up(): void
  12. {
  13. Schema::create('cache', function (Blueprint $table) {
  14. $table->string('key')->primary();
  15. $table->mediumText('value');
  16. $table->integer('expiration');
  17. });
  18. Schema::create('cache_locks', function (Blueprint $table) {
  19. $table->string('key')->primary();
  20. $table->string('owner');
  21. $table->integer('expiration');
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. */
  27. public function down(): void
  28. {
  29. Schema::dropIfExists('cache');
  30. Schema::dropIfExists('cache_locks');
  31. }
  32. };