Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Changing Enum Fields Back To Tinyint Fields

forums forums SQLyog Using SQLyog Changing Enum Fields Back To Tinyint Fields

  • This topic is empty.
Viewing 0 reply threads
  • Author
    Posts
    • #11692
      bkelley
      Member

      Hi, I modified some very large databases and changed the structure of some fields from int to enum, with the hope of making searches faster and shrinking database size. Unfortunately, the data structure change made my PHP code inoperable. So, I now need to change back from the enum datatype to tinyint datatype. When I do a straight copy dataset into a new database with the fields structured as tinyint instead of enum, the values of the new 'tinyint' fields (for example quarter) end up being changed in the new databased and are thus inaccurate, so that the data is incorrect. So, I have created an intermediary database that has “char” fields in place of the enum fields, and that copying seems to work better. Then I will have to modify the char fields to tinyint fields. This all seems pretty laborious, and I am writing to ask if there is a better way.

      I there a way to use the database synchronization tool or the database copy feature in a way that only would copy the data and not the structure? Any other thoughts about changing the data structure from enum (which I am learning is a string field) to a tinyint field?

      thanks,

      Brian

Viewing 0 reply threads
  • You must be logged in to reply to this topic.