Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6884973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:34:35+00:00 2026-05-27T05:34:35+00:00

I have a MySQL database which currently uses a tinyint field to store the

  • 0

I have a MySQL database which currently uses a tinyint field to store the type of record. It uses an odd numbering, and we are in the process to change this. So currently, it reads:

record type
1      60
2      62
3      60
4      61
5      63

The numbers represent the type, with:

60 = car
61 = bike
62 = motorcycle

We need to transform this into an enum field, using the values car, bike, motorcycle. However, the table in question in being used from a very large number of pages, where SELECTs and INSERTs are being made using the original numbers. That will change gradually. So I was wondering: is there a way to change the indexes of the enum field, so that I could change the field to enum and still save a new record with type = 60, and this becomes ‘car’? I know there is a way to set it to 0 and it will become car, but clearly that requires us to change all of the pages and there is no time for this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:34:35+00:00Added an answer on May 27, 2026 at 5:34 am

    Unfortunately this is not possible. The manual itself leaves no room for hope:

    Each enumeration value has an index:

    • Values from the list of permissible elements in the column
    specification are numbered beginning with 1.

    Seeing as there’s nothing you can do about that, I have to ask: why do you need to make this an enum? I have yet to come across a situation where an enum provided any benefit apart convenience to programmers who look at query results by eye. What is the benefit you are looking to gain? I am no guru, but IMHO no matter what you want to achieve there is another (better) way than using an enum.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP web application which uses a MySQL database for object tagging,
I have a PHP search suggestion script which uses a MySQL database as its'
I currently have an application which uses EF database first which was built against
I have a mysql database (Wamp) which uses latin1_swedish to encode characters (é, è,
I have a Rails app (Rails - 2.3.8, Linux) which uses a MySQL database,
I have a mysql database which has grown to over 200 tables in it.
I have a mysql database which as one of the fields contains a html
I have mysql database and I want a software which can draw the database
I have a MySQL database behind a firewall which can only be accessed via
i have a large mysql database table in which one column contains values ranging

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.