简体   繁体   中英

MySQL: Most efficient column type for type (not mime but system or user generated)

I'm trying to think of the most efficient TYPE for MySQL to store what amounts to SYSTEM or USER generated (for the row). SYSTEM generated items can't be deleted, USER generated items can be. I'm thinking INT with a 1/2 for possible values (1:USER || 2:SYSTEM) though I would like input from others. This has nothing to do with mime/media type.

ENUM type can be helpful for preventing bad inputs.

http://dev.mysql.com/doc/refman/5.0/en/enum.html

I decided that I will use the user's id for this column.

To edit/delete/etc the person doing so must either be...

1.) The person who created it.

2.) A person with a higher level of permissions.

I'm trying to keep everything as generic as possible to get as unique perspectives as possible and this approach seems like it will endure the longest possible array of changes in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM