diff --git a/lib/Migration/Version000000Date20240731110600.php b/lib/Migration/Version000000Date20240731110600.php new file mode 100644 index 0000000..5d2a48a --- /dev/null +++ b/lib/Migration/Version000000Date20240731110600.php @@ -0,0 +1,57 @@ +hasTable(self::GROUP_FOLDER_TAGS_TABLE)) { + $table = $schema->createTable(self::GROUP_FOLDER_TAGS_TABLE); + $table->addColumn('group_folder_id', Types::BIGINT, [ + 'notnull' => true, + 'length' => 20, + ]); + $table->addColumn('tag_key', Types::STRING, [ + 'notnull' => true, + 'length' => 50, + ]); + $table->addColumn('tag_value', Types::STRING, [ + 'notnull' => true, + 'length' => 200, + ]); + $table->addColumn('last_updated_timestamp', Types::BIGINT, [ + 'notnull' => true, + ]); + + $table->setPrimaryKey(['group_folder_id', 'tag_key']); + $table->addIndex(['group_folder_id'], 'groupfolder_tags_group_folder_id_index'); + $table->addForeignKeyConstraint( + $schema->getTable(self::GROUP_FOLDERS_TABLE), + ['group_folder_id'], + ['folder_id'], + ['onDelete' => 'CASCADE'], + 'groupfolder_tags_group_folder_id_fk'); + } + + return $schema; + } +} \ No newline at end of file