0001_01_01_000001_create_cache_table.php 849 B

1234567891011121314151617181920212223242526272829303132333435
  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::create('cache', function (Blueprint $table) {
  13. $table->string('key')->primary();
  14. $table->mediumText('value');
  15. $table->integer('expiration');
  16. });
  17. Schema::create('cache_locks', function (Blueprint $table) {
  18. $table->string('key')->primary();
  19. $table->string('owner');
  20. $table->integer('expiration');
  21. });
  22. }
  23. /**
  24. * Reverse the migrations.
  25. */
  26. public function down(): void
  27. {
  28. Schema::dropIfExists('cache');
  29. Schema::dropIfExists('cache_locks');
  30. }
  31. };