Ferreteria/v0.5/sql/user account: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | sql
Jump to navigation Jump to search
(Created page with "==Notes== '''2022-03-17''' I feel like "UserName" is ambiguous. Maybe "AcctName"? "LoginName"? ==SQL== <syntaxhighlight lang=mysql> CREATE TABLE `user_account` ( `ID` int NO...")
 
No edit summary
Line 1: Line 1:
==Notes==
==History==
'''2022-03-17''' I feel like "UserName" is ambiguous. Maybe "AcctName"? "LoginName"?
* '''2022-03-17''' (Note) I feel like "UserName" is ambiguous. Maybe "AcctName"? "LoginName"?
* '''2022-03-23''' Changed "UserName" to "AcctName". Added "WhenLogin" and "WhenLogout".
==SQL==
==SQL==
<syntaxhighlight lang=mysql>
<syntaxhighlight lang=mysql>
CREATE TABLE `user_account` (
CREATE TABLE `user_account` (
   `ID` int NOT NULL AUTO_INCREMENT,
   `ID` int NOT NULL AUTO_INCREMENT,
   `UserName`    varchar(31)      NOT NULL COMMENT 'log in ID',
   `AcctName`    varchar(31)      NOT NULL COMMENT 'log in ID',
   `FullName`    varchar(127) DEFAULT NULL COMMENT 'optional ''real'' name',
   `FullName`    varchar(127) DEFAULT NULL COMMENT 'optional ''real'' name',
   `PassHash`    varbinary(128)  NOT NULL COMMENT 'hash for [password+salt]',
   `PassHash`    varbinary(128)  NOT NULL COMMENT 'hash for [password+salt]',
Line 11: Line 12:
   `EmailAddr`  varchar(255)    NOT NULL COMMENT 'email address',
   `EmailAddr`  varchar(255)    NOT NULL COMMENT 'email address',
   `WhenCreated` datetime        NOT NULL COMMENT 'when user was created',
   `WhenCreated` datetime        NOT NULL COMMENT 'when user was created',
  `WhenLogin`  datetime    DEFAULT NULL COMMENT 'time of last successful login',
  `WhenLogout`  datetime    DEFAULT NULL COMMENT 'time of last explicit logout'
   PRIMARY KEY (`ID`),
   PRIMARY KEY (`ID`),
   UNIQUE KEY `UserName` (`UserName`)
   UNIQUE KEY `UserName` (`UserName`)
) ENGINE=InnoDB;
) ENGINE=InnoDB;
</syntaxhighlight>
</syntaxhighlight>

Revision as of 13:21, 23 March 2022

History

  • 2022-03-17 (Note) I feel like "UserName" is ambiguous. Maybe "AcctName"? "LoginName"?
  • 2022-03-23 Changed "UserName" to "AcctName". Added "WhenLogin" and "WhenLogout".

SQL

CREATE TABLE `user_account` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `AcctName`    varchar(31)      NOT NULL COMMENT 'log in ID',
  `FullName`    varchar(127) DEFAULT NULL COMMENT 'optional ''real'' name',
  `PassHash`    varbinary(128)   NOT NULL COMMENT 'hash for [password+salt]',
  `PassSalt`    varbinary(128)   NOT NULL COMMENT 'random prefix for hashing password',
  `EmailAddr`   varchar(255)     NOT NULL COMMENT 'email address',
  `WhenCreated` datetime         NOT NULL COMMENT 'when user was created',
  `WhenLogin`   datetime     DEFAULT NULL COMMENT 'time of last successful login',
  `WhenLogout`  datetime     DEFAULT NULL COMMENT 'time of last explicit logout'
  PRIMARY KEY (`ID`),
  UNIQUE KEY `UserName` (`UserName`)
) ENGINE=InnoDB;