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

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

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

javascript - Chart.js - setting tooltip z-index -