Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions conf/db/upgrade/V5.5.6__schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ ALTER TABLE `GuestVmScriptExecutedRecordDetailVO`

CALL ADD_COLUMN('PciDeviceVO', 'vmPciDeviceAddress', 'varchar(32)', 1, NULL);
CALL ADD_COLUMN('MdevDeviceVO', 'mdevDeviceAddress', 'varchar(32)', 1, NULL);

-- Add index for modelId field to support duplicate checking
-- Use CREATE_INDEX procedure (defined in beforeMigrate.sql) for idempotent operation
CALL CREATE_INDEX('ModelVO', 'idx_modelId', 'modelId');

-- Upgrade existing data: set modelId to uuid if modelId is NULL
-- This UPDATE is idempotent: WHERE clause ensures only NULL values are updated
UPDATE ModelVO SET modelId = uuid WHERE modelId IS NULL;
3 changes: 3 additions & 0 deletions sdk/src/main/java/org/zstack/sdk/AddModelAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public Result throwExceptionIfError() {
@Param(required = false, maxLength = 512, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String gpuConstraintDescription;

@Param(required = false, maxLength = 255, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String modelId;

@Param(required = false)
public java.lang.String resourceUuid;

Expand Down
3 changes: 3 additions & 0 deletions sdk/src/main/java/org/zstack/sdk/UpdateModelAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public Result throwExceptionIfError() {
@Param(required = false, maxLength = 512, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String gpuConstraintDescription;

@Param(required = false, maxLength = 255, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String modelId;

@Param(required = false)
public java.util.List systemTags;

Expand Down