feat: extend job-profile and feedback entities for future statistics
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20251218100000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Split course category into course_ski/course_board and add event_team category based on job profile names';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// Split course category: profiles with "Ski" in name become course_ski
|
||||
$this->addSql("
|
||||
UPDATE job_profile
|
||||
SET category = 'course_ski'
|
||||
WHERE category = 'course'
|
||||
AND name LIKE '%Ski%'
|
||||
");
|
||||
|
||||
// Split course category: profiles with "Board" or "Snowboard" in name become course_board
|
||||
$this->addSql("
|
||||
UPDATE job_profile
|
||||
SET category = 'course_board'
|
||||
WHERE category = 'course'
|
||||
AND (name LIKE '%Board%' OR name LIKE '%Snowboard%')
|
||||
");
|
||||
|
||||
// New event_team category for profiles containing "Event" in name
|
||||
$this->addSql("
|
||||
UPDATE job_profile
|
||||
SET category = 'event_team'
|
||||
WHERE name LIKE '%Event%'
|
||||
");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// Revert course_ski and course_board back to course
|
||||
$this->addSql("
|
||||
UPDATE job_profile
|
||||
SET category = 'course'
|
||||
WHERE category IN ('course_ski', 'course_board')
|
||||
");
|
||||
|
||||
// Note: Cannot reliably revert event_team as we don't know original category
|
||||
$this->addSql("
|
||||
UPDATE job_profile
|
||||
SET category = 'service'
|
||||
WHERE category = 'event_team'
|
||||
");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user