mysql - Convention for boolean values in databases -
i'm making database first time, exciting, problem comes in form of convention of boolean or binary variables. within database, user makes request server takes few hours resolve (because human on other end has interact it). there few ways label opened or closed request. column called open set true or false or make column called status filled strings "open" or "closed". there convention or being pedantic?
you not being pedantic, , design database in advance based on how going used.
my recommendation have statuschanges
table. each time status changes, have (at least):
- a unique id status change record
- the account being affected
- the new status (and perhaps old status)
- date/time stamp
- person making change
the ability current status user might important. if so, can store information in user record. alternatively, can complicated query on statuschanges
table. or, turn slowing changing dimension having effective , end date each record.
the key point want make should keep history important characteristics of history.
Comments
Post a Comment