From ec78c4a488ba3a20b9c84b566fa97fc2dd2e5c4f Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Wed, 31 Jul 2024 10:41:06 +0000 Subject: [PATCH] added tags database table --- .../Version000000Date20240731110600.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lib/Migration/Version000000Date20240731110600.php 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