auth
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.
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 +);