Re: staff table-howo to connect with bookings and bus. users table
Posted by: Rick James
Date: March 05, 2014 11:19PM

> I assume you are referring to 2 tables:the usertype and buz_usertype.

I am referring to the _columns_ User_type. Today you have have 5 distinct type. I predict that you will have more than 5 in the future.
> `usertype` enum('1','2','3','4','5') DEFAULT NULL,
> `Type_id` enum('1','2','3','4','5') NOT NULL,
(Suggest you name them consistently.)

If those two fields were TINYINT UNSIGNED, you would be perfectly set up go extend the types all the way to 255.

Should an ENUM be the PRIMARY KEY? Rarely. However, `buz_usertype` is an example of where it makes sense. Presumably you have exactly 5 rows in that table.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.