Repository navigation
feat: library release management - library resolver - #101
Peterburnett wants to merge 2 commits into
Conversation
c4cf096 to
fa2ee00
Compare
961757b to
4744f53
Compare
rhell4
left a comment
There was a problem hiding this comment.
My biggest concern is recreating a few of the existing tables with a few field differences to accommodate the new faction and release relations.
We should be able to do this by changing the existing tables. When the release management feature is deployed there should be no need to keep these tables unchanged as they would no longer be used the original way.
| function xmldb_hvp_install() { | ||
| global $DB; | ||
|
|
||
| if (!$DB->record_exists('hvp_library_release_state', ['id' => 1])) { |
There was a problem hiding this comment.
While an id of 1 is almost always correct it isn't always guaranteed. We should just be checking if any record exists at all regardless of id.
| <TABLE NAME="hvp_library_release_content_libraries" COMMENT="Artifact dependencies selected for HVP activities"> | ||
| <FIELDS> | ||
| <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> | ||
| <FIELD NAME="hvp_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="artifact_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="dependency_type" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="drop_css" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> | ||
| <FIELD NAME="weight" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> | ||
| </FIELDS> | ||
| <KEYS> | ||
| <KEY NAME="primary" TYPE="primary" FIELDS="id"/> | ||
| </KEYS> | ||
| <INDEXES> | ||
| <INDEX NAME="content_artifact_type" UNIQUE="true" FIELDS="hvp_id, artifact_id, dependency_type"/> | ||
| <INDEX NAME="hvp_id" UNIQUE="false" FIELDS="hvp_id"/> | ||
| </INDEXES> | ||
| </TABLE> |
There was a problem hiding this comment.
We shouldn't need to create a whole new table for this, we can add the new artifact_id field and remove the old library_id from the existing hvp_contents_libraries table.
| <TABLE NAME="hvp_library_artifact_dependencies" COMMENT="Dependencies between immutable library artifacts"> | ||
| <FIELDS> | ||
| <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> | ||
| <FIELD NAME="artifact_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="required_artifact_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="dependency_type" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/> | ||
| </FIELDS> | ||
| <KEYS> | ||
| <KEY NAME="primary" TYPE="primary" FIELDS="id"/> | ||
| </KEYS> | ||
| <INDEXES> | ||
| <INDEX NAME="artifact_required_type" UNIQUE="true" FIELDS="artifact_id, required_artifact_id, dependency_type"/> | ||
| <INDEX NAME="required_artifact_id" UNIQUE="false" FIELDS="required_artifact_id"/> | ||
| </INDEXES> | ||
| </TABLE> |
There was a problem hiding this comment.
We shouldn't need to create a whole new table for this, we can add the new artifact_id and required_artifcat_id fields to hvp_libraries_libraries and remove the library_id and required_library_id fields.
| <TABLE NAME="hvp_library_artifact_languages" COMMENT="Translations for immutable library artifacts"> | ||
| <FIELDS> | ||
| <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> | ||
| <FIELD NAME="artifact_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="language_code" TYPE="char" LENGTH="31" NOTNULL="true" SEQUENCE="false"/> | ||
| <FIELD NAME="language_json" TYPE="text" NOTNULL="true" SEQUENCE="false"/> | ||
| </FIELDS> | ||
| <KEYS> | ||
| <KEY NAME="primary" TYPE="primary" FIELDS="id"/> | ||
| </KEYS> | ||
| <INDEXES> | ||
| <INDEX NAME="artifact_language" UNIQUE="true" FIELDS="artifact_id, language_code"/> | ||
| </INDEXES> | ||
| </TABLE> |
There was a problem hiding this comment.
We shouldn't need to create a whole new table for this, we should be able to convert the library_id field to artifact_id in the existing hvp_libraries_languages table.
|
|
||
| $DB->delete_records('hvp_library_release_state'); | ||
| hvp_upgrade_2026082600(); | ||
| hvp_upgrade_2026082600(); |
No description provided.