'Schema Validation Error for custom queryable states using `UUID` as a column

I have defined a custom QueryableState whose persistent counterpart is defined by the code below

@Entity
@Table(name = "contract_course_class_state")
data class PersistentCourseClass(
    @Column(nullable = false)
    var courseId: UUID? = null
): PersistentState()

The problem is the node cannot startup with the following error:

[ERROR] 14:07:12+0800 [main] internal.NodeStartupLogging. - Exception during node startup: Incompatible schema change detected. Please run schema migration scripts (node with sub-command run-migration-scripts). Reason: Schema-validation: wrong column type encountered in column [courseId] in table [contract_course_class_state]; found [varbinary (Types#VARBINARY)], but expecting [binary (Types#BINARY)]

I have already run migration scripts as suggested but the problem still occurs. How can I resolve this?

Corda version: 4.8



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source