0001_01_01_000001_create_cache_table.php 943 B

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