Cut down version of messages:
CREATE TABLE messages (
seen_flag INT2 DEFAULT '0' NOT NULL,
answered_flag INT2 DEFAULT '0' NOT NULL,
deleted_flag INT2 DEFAULT '0' NOT NULL,
flagged_flag INT2 DEFAULT '0' NOT NULL,
recent_flag INT2 DEFAULT '0' NOT NULL,
draft_flag INT2 DEFAULT '0' NOT NULL,
status INT2 DEFAULT '000' NOT NULL,
);
This is what the status field is defined to be:
typedef enum {
MESSAGE_STATUS_NEW = 0,
MESSAGE_STATUS_SEEN = 1,
MESSAGE_STATUS_DELETE = 2,
MESSAGE_STATUS_PURGE = 3,
MESSAGE_STATUS_UNUSED = 4,
MESSAGE_STATUS_INSERT = 5,
MESSAGE_STATUS_ERROR = 6
} MessageStatus_t;
Now, why do we have both a seen status and a seen flag?
And what about the delete status and deleted flag?
And why do we define the status flag to be '000' and not '0'?
-HK