diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-04-30 12:01:30 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-04-30 12:01:30 +0200 |
commit | 8b2bf0516a417e517189fa7ea9bd1f45c834a707 (patch) | |
tree | 55e667d59309ee578e2c15cfc393d125913c6265 | |
parent | b1c035600b6255b03a4b6930ce61698274ba9de2 (diff) | |
download | aCms-8b2bf0516a417e517189fa7ea9bd1f45c834a707.tar.gz aCms-8b2bf0516a417e517189fa7ea9bd1f45c834a707.tar.bz2 |
introduced an user status for registration and active status
-rw-r--r-- | sql/sqlite3.sql | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sql/sqlite3.sql b/sql/sqlite3.sql index beefe6e..ee9abc6 100644 --- a/sql/sqlite3.sql +++ b/sql/sqlite3.sql @@ -1,16 +1,32 @@ +PRAGMA foreign_keys = ON; + drop table if exists login; drop table if exists user; +drop table if exists userstatus; + +create table userstatus( + status char(1) primary key not null, + description varchar(32) not null +); + +insert into userstatus values( 'U', 'User unknown' ); +insert into userstatus values( 'R', 'Currently in registration' ); +insert into userstatus values( 'A', 'Registration ok, user active' ); +insert into userstatus values( 'D', 'User disabled' ); create table user( id integer primary key autoincrement not null, username varchar(32) unique not null, - password varchar(32) not null + password varchar(32) not null, + status char(1) references userstatus(status) default 'U', + registration_start timestamp, + code varchar(32) ); -insert into user(username, password) values('admin','admin'); +insert into user(username, password, status) values('admin','admin', 'A'); create table login( id integer primary key autoincrement not null, user_id integer references user(id), - last_login TIMESTAMP + last_login timestamp ); |