mirror of
https://github.com/Yubico/yubikey-ksm.git
synced 2024-12-01 15:24:17 +01:00
39 lines
985 B
SQL
39 lines
985 B
SQL
drop database ykksm;
|
|
create database ykksm;
|
|
use ykksm;
|
|
|
|
create table yubikeys (
|
|
id int not null auto_increment,
|
|
|
|
-- identities:
|
|
serialNr int not null,
|
|
publicName varchar(16) unique not null,
|
|
|
|
-- timestamps:
|
|
created datetime not null,
|
|
accessed datetime,
|
|
|
|
-- the data:
|
|
internalName varchar(12) not null,
|
|
aesKey varchar(32) not null,
|
|
lockCode varchar(12) not null,
|
|
|
|
-- key creator, typically pgp key id of key generator
|
|
creator varchar(8) not null,
|
|
|
|
-- various flags:
|
|
active boolean default true,
|
|
hardware boolean default true,
|
|
|
|
primary key (id)
|
|
-- MySQL generates an index automatically for columns marked 'unique'
|
|
-- if this doesn't seem to happen, add: 'key (publicName)'
|
|
-- use, e.g., explain select * from yubikeys where publicName = 'foo';
|
|
-- and make sure it uses a key to find the column.
|
|
);
|
|
|
|
drop user ykksmreader;
|
|
create user ykksmreader;
|
|
grant select, update(accessed) on ykksm.yubikeys to 'ykksmreader'@'localhost';
|
|
flush privileges;
|