auth

Paddy 2015-04-06 Parent:de5e09680f6b Child:762953f6a7f2

154:5f670aba87b4 Go to Latest

auth/sql/postgres_init.sql

Implement a session store in postgres. Write the postgres implementation of our sessionStore type. Write the SQL statements to initialize the database for us. Include the postgres implementation of our sessionStore type in our sessionStore tests when the appropriate environment variable is passed.

History
     1.1 --- a/sql/postgres_init.sql	Tue Mar 24 21:50:42 2015 -0400
     1.2 +++ b/sql/postgres_init.sql	Mon Apr 06 07:58:10 2015 -0400
     1.3 @@ -46,3 +46,15 @@
     1.4  	name VARCHAR(64) NOT NULL,
     1.5  	description TEXT NOT NULL
     1.6  );
     1.7 +
     1.8 +CREATE TABLE IF NOT EXISTS sessions (
     1.9 +	id VARCHAR(72) PRIMARY KEY,
    1.10 +	ip VARCHAR(32) NOT NULL,
    1.11 +	user_agent TEXT NOT NULL,
    1.12 +	profile_id VARCHAR(36) NOT NULL,
    1.13 +	login VARCHAR(64) NOT NULL,
    1.14 +	created TIMESTAMPTZ NOT NULL,
    1.15 +	expires TIMESTAMPTZ NOT NULL,
    1.16 +	active BOOLEAN NOT NULL,
    1.17 +	csrftoken VARCHAR(72) NOT NULL
    1.18 +);