Files
pterodactyl-panel/database/migrations/2017_02_10_171858_UpdateAPIKeyColumnNames.php
T

35 lines
854 B
PHP
Raw Normal View History

2017-02-10 17:29:10 -05:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateAPIKeyColumnNames extends Migration
{
/**
* Run the migrations.
*/
2024-10-21 19:18:20 -06:00
public function up(): void
2017-02-10 17:29:10 -05:00
{
Schema::table('api_keys', function (Blueprint $table) {
2024-10-21 19:18:20 -06:00
$table->dropForeign(['user']);
2017-02-10 17:29:10 -05:00
$table->renameColumn('user', 'user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*/
2024-10-21 19:18:20 -06:00
public function down(): void
2017-02-10 17:29:10 -05:00
{
Schema::table('api_keys', function (Blueprint $table) {
2024-10-21 19:18:20 -06:00
$table->dropForeign(['user_id']);
2017-02-10 17:29:10 -05:00
$table->renameColumn('user_id', 'user');
$table->foreign('user')->references('id')->on('users');
});
}
}