Created some SQL that creates the necessary user management tables in
MySQL syntax. git-svn-id: https://samskivert.googlecode.com/svn/trunk@69 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* $Id: create_user_tables.mysql,v 1.1 2001/03/02 01:22:46 mdb Exp $
|
||||||
|
*
|
||||||
|
* Creates the necessary database tables in MySQL for the user repository.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The users table contains a row for every user.
|
||||||
|
*/
|
||||||
|
DROP TABLE IF EXISTS users;
|
||||||
|
CREATE TABLE users (
|
||||||
|
userid INTEGER(10) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
username VARCHAR(24) NOT NULL,
|
||||||
|
password VARCHAR(13) NOT NULL,
|
||||||
|
email VARCHAR(128) NOT NULL,
|
||||||
|
realname VARCHAR(128) NOT NULL,
|
||||||
|
created DATE NOT NULL,
|
||||||
|
|
||||||
|
UNIQUE INDEX username_index (username)
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sessions table contains a row for every authenticated
|
||||||
|
* user. Sessions map a session identifier to a user record and expire
|
||||||
|
* after an application determined amount of time. A request that supplies
|
||||||
|
* a valid session identifier is treated as being authenticated as the
|
||||||
|
* user to which that session is mapped, so long timeouts are discouraged.
|
||||||
|
*/
|
||||||
|
DROP TABLE IF EXISTS sessions;
|
||||||
|
CREATE TABLE sessions (
|
||||||
|
sessionid INTEGER(10) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
authcode VARCHAR(32) NOT NULL,
|
||||||
|
userid INTEGER(10) NOT NULL,
|
||||||
|
expires DATE NOT NULL,
|
||||||
|
|
||||||
|
UNIQUE INDEX authcode_index (authcode)
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user