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):

  1. add new column table numerical.
  2. copy values column new one.
  3. delete content of column
  4. alter table make string column
  5. copy values column original one.

this detailed , not sure if asking...


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -