1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-20 01:52:15 +01:00

Simplify.

This commit is contained in:
Simon Josefsson 2009-03-18 10:28:06 +00:00
parent 136a6c9c98
commit f6637531d0

View File

@ -1,36 +1,11 @@
DROP TABLE IF EXISTS admin;
CREATE TABLE admin (
id int(10) unsigned NOT NULL auto_increment,
keyid int NOT NULL default '0',
note varchar(45) default NULL,
pin varchar(120) default NULL,
last_access datetime default NULL,
ip varchar(45) default NULL,
creation datetime default NULL,
client int NOT NULL default '0',
timeout int unsigned NOT NULL default '3600',
PRIMARY KEY (id),
KEY FK_admin_2 (keyid),
KEY FK_admin_1 (client),
CONSTRAINT FK_admin_1 FOREIGN KEY (client) REFERENCES clients (id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_admin_2 FOREIGN KEY (keyid) REFERENCES yubikeys (id) ON DELETE CASCADE ON UPDATE CASCADE
);
// DROP DATABASE yubico;
// CREATE DATABASE yubico;
// USE yubico;
DROP TABLE IF EXISTS buyers;
CREATE TABLE buyers (
id int unsigned NOT NULL auto_increment,
email varchar(100) default NULL,
created datetime default NULL,
addr varchar(200) default NULL,
qty int unsigned default NULL,
client_id int NOT NULL default '0',
name varchar(45) default NULL,
PRIMARY KEY (id),
KEY FK_client_id_1 (client_id),
CONSTRAINT FK_client_info_1 FOREIGN KEY (client_id) REFERENCES clients (id) ON DELETE CASCADE ON UPDATE CASCADE
);
// DROP TABLE IF EXISTS clients;
// DROP TABLE IF EXISTS perms;
// DROP TABLE IF EXISTS yubikeys;
DROP TABLE IF EXISTS clients;
CREATE TABLE clients (
id int NOT NULL auto_increment,
perm_id int default NULL,
@ -48,19 +23,6 @@ CREATE TABLE clients (
CONSTRAINT clients_ibfk_1 FOREIGN KEY (perm_id) REFERENCES perms (id)
);
DROP TABLE IF EXISTS history;
CREATE TABLE history (
id int unsigned NOT NULL auto_increment,
usrid int unsigned NOT NULL default '0',
note varchar(45) NOT NULL default '',
ip varchar(45) NOT NULL default '',
creation datetime NOT NULL,
keyid int unsigned NOT NULL default '0',
PRIMARY KEY (id),
KEY FK_hist_1 (usrid)
);
DROP TABLE IF EXISTS perms;
CREATE TABLE perms (
id int NOT NULL auto_increment,
verify_otp boolean default false,
@ -71,26 +33,22 @@ CREATE TABLE perms (
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS yubikeys;
CREATE TABLE yubikeys (
id int NOT NULL auto_increment,
id int NOT NULL UNIQUE auto_increment,
client_id int NOT NULL default '0',
active boolean default true,
created datetime NOT NULL,
accessed datetime,
tokenId varchar(60),
userId varchar(60) NOT NULL,
tokenId varchar(60) binary unique not null,
userId varchar(60) UNIQUE NOT NULL,
secret varchar(60) NOT NULL,
counter int,
low int,
high int,
notes varchar(100),
serial varchar(45),
serial varchar(45) UNIQUE,
sessionUse int,
PRIMARY KEY (id),
UNIQUE KEY userId (userId),
UNIQUE KEY tokenId (tokenId),
UNIQUE KEY sn (serial),
KEY client_id (client_id),
CONSTRAINT yubikeys_ibfk_1 FOREIGN KEY (client_id) REFERENCES clients (id)
);