mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-26 08:06:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			43 lines
		
	
	
		
			994 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			994 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| use Illuminate\Support\Facades\Schema;
 | |
| use Illuminate\Database\Schema\Blueprint;
 | |
| use Illuminate\Database\Migrations\Migration;
 | |
| 
 | |
| return new class extends Migration
 | |
| {
 | |
|     /**
 | |
|      * Run the migrations.
 | |
|      *
 | |
|      *
 | |
|      * @throws \Exception
 | |
|      * @throws \Throwable
 | |
|      */
 | |
|     public function up(): void
 | |
|     {
 | |
|         Schema::table('api_keys', function (Blueprint $table) {
 | |
|             $table->char('identifier', 16)->nullable()->unique()->after('user_id');
 | |
|             $table->dropUnique(['token']);
 | |
|         });
 | |
| 
 | |
|         Schema::table('api_keys', function (Blueprint $table) {
 | |
|             $table->text('token')->change();
 | |
|         });
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Reverse the migrations.
 | |
|      *
 | |
|      *
 | |
|      * @throws \Exception
 | |
|      * @throws \Throwable
 | |
|      */
 | |
|     public function down(): void
 | |
|     {
 | |
|         Schema::table('api_keys', function (Blueprint $table) {
 | |
|             $table->dropColumn('identifier');
 | |
|             $table->string('token', 32)->unique()->change();
 | |
|         });
 | |
|     }
 | |
| };
 | 
