File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
app/Models/Foundation/Summit
database/migrations/model Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ class SummitDocument extends SilverstripeBaseModel
4949 #[ORM \Column(name: 'Description ' , type: 'string ' )]
5050 private $ description ;
5151
52+ /**
53+ * @var string
54+ */
55+ #[ORM \Column(name: 'ClassName ' , type: 'string ' )]
56+ private $ class_name ;
57+
5258 /**
5359 * @var string
5460 */
@@ -96,6 +102,7 @@ class SummitDocument extends SilverstripeBaseModel
96102 public function __construct ()
97103 {
98104 parent ::__construct ();
105+ $ this ->class_name = 'SummitDocument ' ;
99106 $ this ->event_types = new ArrayCollection ();
100107 $ this ->file = null ;
101108 $ this ->label = '' ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Database \Migrations \Model ;
6+
7+ use Doctrine \DBAL \Schema \Schema ;
8+ use Doctrine \Migrations \AbstractMigration ;
9+
10+ /**
11+ * Auto-generated Migration: Please modify to your needs!
12+ */
13+ final class Version20251203141656 extends AbstractMigration
14+ {
15+ public function getDescription (): string
16+ {
17+ return 'set default to SummitDocument ClassName ' ;
18+ }
19+
20+ public function up (Schema $ schema ): void
21+ {
22+ $ sql = <<<SQL
23+ ALTER TABLE SummitDocument CHANGE `ClassName` `ClassName` ENUM('SummitDocument')
24+ CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL DEFAULT 'SummitDocument';
25+ SQL ;
26+
27+ $ this ->addSql ($ sql );
28+ }
29+
30+ public function down (Schema $ schema ): void
31+ {
32+ // this down() migration is auto-generated, please modify it to your needs
33+
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments