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
Simon Josefsson 2875ac9d18 Fix perms.
2009-04-27 19:10:27 +00:00

36 lines
922 B
SQL

-- DROP DATABASE ykval;
CREATE DATABASE ykval;
USE ykval;
CREATE TABLE clients (
id INT NOT NULL AUTO_INCREMENT,
active BOOLEAN DEFAULT TRUE,
created DATETIME NOT NULL,
email VARCHAR(255) NOT NULL DEFAULT '',
secret VARCHAR(60) NOT NULL DEFAULT '',
chk_time BOOLEAN DEFAULT TRUE,
PRIMARY KEY (id)
);
CREATE TABLE yubikeys (
id INT NOT NULL UNIQUE AUTO_INCREMENT,
active BOOLEAN DEFAULT TRUE,
created DATETIME NOT NULL,
accessed DATETIME,
publicName VARCHAR(16) UNIQUE NOT NULL,
internalName VARCHAR(12) NOT NULL,
counter INT,
low INT,
high INT,
sessionUse INT,
PRIMARY KEY (id)
);
-- DROP USER ykval_verifier;
CREATE USER ykval_verifier;
GRANT SELECT,INSERT,UPDATE(accessed, counter, low, high, sessionUse)
ON ykval.yubikeys to 'ykval_verifier'@'localhost';
GRANT SELECT(id, secret, chk_time, active)
ON ykval.clients to 'ykval_verifier'@'localhost';
FLUSH PRIVILEGES;