Clean up the way we specify the CREATE TABLE statement
This commit is contained in:
parent
2fc037c81e
commit
f6cbf2c4df
14
pgstore.go
14
pgstore.go
|
@ -226,13 +226,13 @@ func (db *PGStore) destroy(session *sessions.Session) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *PGStore) createSessionsTable() error {
|
func (db *PGStore) createSessionsTable() error {
|
||||||
stmt := "CREATE TABLE IF NOT EXISTS http_sessions (" +
|
stmt := `CREATE TABLE IF NOT EXISTS http_sessions (
|
||||||
"id BIGSERIAL PRIMARY KEY," +
|
id BIGSERIAL PRIMARY KEY,
|
||||||
"key BYTEA," +
|
key BYTEA,
|
||||||
"data BYTEA," +
|
data BYTEA,
|
||||||
"created_on TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP," +
|
created_on TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
"modified_on TIMESTAMPTZ," +
|
modified_on TIMESTAMPTZ,
|
||||||
"expires_on TIMESTAMPTZ);"
|
expires_on TIMESTAMPTZ);`
|
||||||
|
|
||||||
_, err := db.DbPool.Exec(stmt)
|
_, err := db.DbPool.Exec(stmt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue