Files
panel-pelican-dev/database/migrations/2017_03_16_181515_CleanupDatabasesDatabase.php

37 lines
920 B
PHP
Raw Normal View History

2017-03-16 19:35:29 -04:00
<?php
use Illuminate\Database\Migrations\Migration;
2025-09-24 13:34:19 +02:00
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2017-03-16 19:35:29 -04:00
2024-03-19 21:03:50 -04:00
return new class extends Migration
2017-03-16 19:35:29 -04:00
{
/**
* Run the migrations.
*/
2024-03-19 21:12:27 -04:00
public function up(): void
2017-03-16 19:35:29 -04:00
{
Schema::table('databases', function (Blueprint $table) {
$table->dropForeign(['db_server']);
2017-03-16 19:35:29 -04:00
$table->renameColumn('db_server', 'database_host_id');
$table->foreign('database_host_id')->references('id')->on('database_hosts');
});
}
/**
* Reverse the migrations.
*/
2024-03-19 21:12:27 -04:00
public function down(): void
2017-03-16 19:35:29 -04:00
{
Schema::table('databases', function (Blueprint $table) {
$table->dropForeign(['database_host_id']);
2017-03-16 19:35:29 -04:00
$table->renameColumn('database_host_id', 'db_server');
$table->foreign('db_server')->references('id')->on('database_hosts');
});
}
2024-03-19 21:03:50 -04:00
};