database: fix migrations with postgres

This commit is contained in:
Matthew Penner 2022-12-14 18:17:16 -07:00
parent f68c46b0a0
commit 2f15d94957
No known key found for this signature in database

View file

@ -12,9 +12,9 @@ return new class () extends Migration {
public function up(): void public function up(): void
{ {
Schema::table('nodes', function (Blueprint $table) { Schema::table('nodes', function (Blueprint $table) {
$table->renameColumn('daemonListen', 'listen_port_http'); $table->renameColumn('`daemonListen`', 'listen_port_http');
$table->renameColumn('daemonSFTP', 'listen_port_sftp'); $table->renameColumn('`daemonSFTP`', 'listen_port_sftp');
$table->renameColumn('daemonBase', 'daemon_base'); $table->renameColumn('`daemonBase`', 'daemon_base');
}); });
Schema::table('nodes', function (Blueprint $table) { Schema::table('nodes', function (Blueprint $table) {
@ -42,9 +42,9 @@ return new class () extends Migration {
public function down(): void public function down(): void
{ {
Schema::table('nodes', function (Blueprint $table) { Schema::table('nodes', function (Blueprint $table) {
$table->renameColumn('listen_port_http', 'daemonListen'); $table->renameColumn('listen_port_http', '`daemonListen`');
$table->renameColumn('listen_port_sftp', 'daemonSFTP'); $table->renameColumn('listen_port_sftp', '`daemonSFTP`');
$table->renameColumn('daemon_base', 'daemonBase'); $table->renameColumn('daemon_base', '`daemonBase`');
$table->dropColumn('public_port_http'); $table->dropColumn('public_port_http');
$table->dropColumn('public_port_sftp'); $table->dropColumn('public_port_sftp');