java - Change from @Enumerated to @Enumerated(EnumType.STRING) on database -
i have annotation @enumerated on fields in application thats working. told change @enumerated(enumtype.string) prevent problems if enum values change. database populated, question is
what way change values on database 1,2,3.. corresponding string values of enum class?
if asking how can maintain values , change db think have in few steps(the basic algorithm switch values):
- add new column table numerical.
- copy values column new one.
- delete content of column
- alter table make string column
- copy values column original one.
this detailed , not sure if asking...
Comments
Post a Comment