1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 00:24:13 +01:00
yubikey-val/ykval-db.sql

50 lines
1.3 KiB
MySQL
Raw Normal View History

CREATE DATABASE yubico;
USE yubico;
2009-02-25 13:20:53 +01:00
CREATE TABLE clients (
id int NOT NULL auto_increment,
perm_id int default NULL,
active boolean default true,
created datetime NOT NULL,
email varchar(255) NOT NULL default '',
secret varchar(60) NOT NULL default '',
notes varchar(100) default NULL,
chk_sig boolean default false,
chk_owner boolean default false,
chk_time boolean default true,
PRIMARY KEY (id),
UNIQUE KEY email (email),
KEY perm_id (perm_id),
CONSTRAINT clients_ibfk_1 FOREIGN KEY (perm_id) REFERENCES perms (id)
);
CREATE TABLE perms (
id int NOT NULL auto_increment,
verify_otp boolean default false,
add_clients boolean default false,
delete_clients boolean default false,
add_keys boolean default false,
delete_keys boolean default false,
PRIMARY KEY (id)
);
CREATE TABLE yubikeys (
2009-03-18 11:28:06 +01:00
id int NOT NULL UNIQUE auto_increment,
2009-02-25 13:20:53 +01:00
client_id int NOT NULL default '0',
active boolean default true,
created datetime NOT NULL,
accessed datetime,
2009-03-18 11:28:06 +01:00
tokenId varchar(60) binary unique not null,
userId varchar(60) NOT NULL,
2009-02-25 13:20:53 +01:00
secret varchar(60) NOT NULL,
counter int,
low int,
high int,
notes varchar(100),
2009-03-18 11:28:06 +01:00
serial varchar(45) UNIQUE,
2009-02-25 13:20:53 +01:00
sessionUse int,
PRIMARY KEY (id),
KEY client_id (client_id),
CONSTRAINT yubikeys_ibfk_1 FOREIGN KEY (client_id) REFERENCES clients (id)
);