Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions database/migrations/2026_08_30_150156_fix_sorting_photos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* SPDX-License-Identifier: MIT
* Copyright (c) 2017-2018 Tobias Reich
* Copyright (c) 2018-2026 LycheeOrg.
*/

use Illuminate\Database\Migrations\Migration;

return new class() extends Migration {
private const REMOVED_VALUES = ['title_strict', 'description', 'description_strict'];

/**
* Run the migrations.
*/
public function up(): void
{
DB::table('base_albums')
->whereIn('sorting_col', self::REMOVED_VALUES)
->update(['sorting_col' => 'title']);
}

/**
* Reverse the migrations.
*/
public function down(): void
{
// no coming back.
// Sowwy
}
};
52 changes: 52 additions & 0 deletions database/migrations/2026_08_30_150404_bump_version070802.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/**
* SPDX-License-Identifier: MIT
* Copyright (c) 2017-2018 Tobias Reich
* Copyright (c) 2018-2026 LycheeOrg.
*/

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\ConsoleSectionOutput;

return new class() extends Migration {
private ConsoleOutput $output;
private ConsoleSectionOutput $msg_section;

public function __construct()
{
$this->output = new ConsoleOutput();
$this->msg_section = $this->output->section();
}

/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
DB::table('configs')->where('key', 'version')->update(['value' => '070802']);
try {
Artisan::call('cache:clear');
} catch (\Throwable $e) {
$this->msg_section->writeln('<error>Warning:</error> Failed to clear cache for version 7.8.2');

return;
}
$this->msg_section->writeln('<info>Info:</info> Cleared cache for version 7.8.2');
Comment thread
ildyria marked this conversation as resolved.
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
DB::table('configs')->where('key', 'version')->update(['value' => '070801']);
}
};
Loading
Loading