2023-03-16 13:00:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @copyright 2022 Ad Aures
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Media\Database\Migrations;
|
|
|
|
|
2023-06-13 16:05:02 +00:00
|
|
|
use App\Database\Migrations\BaseMigration;
|
2024-05-29 10:24:13 +00:00
|
|
|
use Override;
|
2023-03-16 13:00:05 +00:00
|
|
|
|
2023-06-13 16:05:02 +00:00
|
|
|
class RenameMediafileKey extends BaseMigration
|
2023-03-16 13:00:05 +00:00
|
|
|
{
|
2024-05-29 10:24:13 +00:00
|
|
|
#[Override]
|
2023-03-16 13:00:05 +00:00
|
|
|
public function up(): void
|
|
|
|
{
|
|
|
|
$fields = [
|
2023-03-17 18:04:04 +00:00
|
|
|
'file_path' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'name' => 'file_key',
|
|
|
|
'type' => 'VARCHAR',
|
2023-03-16 13:00:05 +00:00
|
|
|
'constraint' => 255,
|
|
|
|
],
|
|
|
|
];
|
|
|
|
$this->forge->modifyColumn('media', $fields);
|
|
|
|
}
|
|
|
|
|
2024-05-29 10:24:13 +00:00
|
|
|
#[Override]
|
2023-03-16 13:00:05 +00:00
|
|
|
public function down(): void
|
|
|
|
{
|
|
|
|
$fields = [
|
|
|
|
'file_key' => [
|
2023-06-12 14:47:38 +00:00
|
|
|
'name' => 'file_path',
|
|
|
|
'type' => 'VARCHAR',
|
2023-03-16 13:00:05 +00:00
|
|
|
'constraint' => 255,
|
|
|
|
],
|
|
|
|
];
|
|
|
|
$this->forge->modifyColumn('media', $fields);
|
|
|
|
}
|
|
|
|
}
|