small adjustments to auth schema

Nothing uses the user and user_session tables yet; I'm trying to
anticipate what auth will need before freezing schema version 3.
This commit is contained in:
Scott Lamb
2018-04-27 06:24:02 -07:00
parent b0071515e0
commit 9982c0b080
2 changed files with 31 additions and 15 deletions

View File

@@ -73,19 +73,20 @@ pub fn run(args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
flags integer not null,
password_hash text,
password_id integer not null default 0,
password_failure_count integer not null,
password_failure_count integer not null default 0,
unix_uid integer
);
create table user_session (
session_id_hash blob primary key not null,
user_id integer references user (id) not null,
seed blob not null,
flags integer not null,
domain text,
description text,
creation_password_id integer,
creation_peer_addr blob,
creation_time_sec integer not null,
creation_user_agent text,
creation_peer_addr blob,
revocation_time_sec integer,
revocation_user_agent text,
revocation_peer_addr blob,
@@ -94,7 +95,7 @@ pub fn run(args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
last_use_time_sec integer,
last_use_user_agent text,
last_use_peer_addr blob,
use_count not null
use_count not null default 0
) without rowid;
"#)?;
let db_uuid = ::uuid::Uuid::new_v4();