Clean up the way we specify the CREATE TABLE statement

This commit is contained in:
Chris Johnson
2016-08-12 13:19:46 -04:00
parent 2fc037c81e
commit f6cbf2c4df

View File

@@ -226,13 +226,13 @@ func (db *PGStore) destroy(session *sessions.Session) error {
}
func (db *PGStore) createSessionsTable() error {
stmt := "CREATE TABLE IF NOT EXISTS http_sessions (" +
"id BIGSERIAL PRIMARY KEY," +
"key BYTEA," +
"data BYTEA," +
"created_on TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP," +
"modified_on TIMESTAMPTZ," +
"expires_on TIMESTAMPTZ);"
stmt := `CREATE TABLE IF NOT EXISTS http_sessions (
id BIGSERIAL PRIMARY KEY,
key BYTEA,
data BYTEA,
created_on TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
modified_on TIMESTAMPTZ,
expires_on TIMESTAMPTZ);`
_, err := db.DbPool.Exec(stmt)
if err != nil {