From 540439b777da394eab199e9726c7aa55f9ba7f46 Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Sun, 14 Apr 2024 01:45:46 -0500 Subject: [PATCH] Internal: Add collapsed field to session_rel_user --- src/CoreBundle/Entity/SessionRelUser.php | 3 ++ .../Schema/V200/Version20240414014200.php | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/CoreBundle/Migrations/Schema/V200/Version20240414014200.php diff --git a/src/CoreBundle/Entity/SessionRelUser.php b/src/CoreBundle/Entity/SessionRelUser.php index adb57eed23..f5e0a0d9a7 100644 --- a/src/CoreBundle/Entity/SessionRelUser.php +++ b/src/CoreBundle/Entity/SessionRelUser.php @@ -105,6 +105,9 @@ class SessionRelUser #[Groups(['session_rel_user:read'])] protected Collection $courses; + #[ORM\Column(name: 'collapsed', type: 'boolean', nullable: true, options: ['default' => null])] + protected ?bool $collapsed = null; + /** * @throws Exception */ diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240414014200.php b/src/CoreBundle/Migrations/Schema/V200/Version20240414014200.php new file mode 100644 index 0000000000..2ede2e6a65 --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240414014200.php @@ -0,0 +1,32 @@ +getTable('session_rel_user')->hasColumn('collapsed')) { + $this->addSql('ALTER TABLE session_rel_user ADD collapsed TINYINT(1) DEFAULT NULL'); + } + } + + public function down(Schema $schema): void + { + if ($schema->getTable('session_rel_user')->hasColumn('collapsed')) { + $this->addSql('ALTER TABLE session_rel_user DROP COLUMN collapsed'); + } + } +}