Fix SQL storage
This commit is contained in:
parent
b9b315dd64
commit
80995dff9b
2 changed files with 13 additions and 15 deletions
|
@ -330,7 +330,7 @@ func getRefresh(q querier, id string) (storage.RefreshToken, error) {
|
||||||
claims_user_id, claims_username, claims_preferred_username,
|
claims_user_id, claims_username, claims_preferred_username,
|
||||||
claims_email, claims_email_verified,
|
claims_email, claims_email_verified,
|
||||||
claims_groups,
|
claims_groups,
|
||||||
connector_id, connector_data,
|
connector_id,
|
||||||
token, created_at, last_used
|
token, created_at, last_used
|
||||||
from refresh_token where id = $1;
|
from refresh_token where id = $1;
|
||||||
`, id))
|
`, id))
|
||||||
|
@ -685,7 +685,7 @@ func (c *conn) UpdateOfflineSessions(userID string, connID string, updater func(
|
||||||
_, err = tx.Exec(`
|
_, err = tx.Exec(`
|
||||||
update offline_session
|
update offline_session
|
||||||
set
|
set
|
||||||
refresh = $1
|
refresh = $1,
|
||||||
connector_data = $2
|
connector_data = $2
|
||||||
where user_id = $3 AND conn_id = $4;
|
where user_id = $3 AND conn_id = $4;
|
||||||
`,
|
`,
|
||||||
|
|
|
@ -90,18 +90,17 @@ var migrations = []migration{
|
||||||
nonce text not null,
|
nonce text not null,
|
||||||
state text not null,
|
state text not null,
|
||||||
force_approval_prompt boolean not null,
|
force_approval_prompt boolean not null,
|
||||||
|
|
||||||
logged_in boolean not null,
|
logged_in boolean not null,
|
||||||
|
|
||||||
claims_user_id text not null,
|
claims_user_id text not null,
|
||||||
claims_username text not null,
|
claims_username text not null,
|
||||||
claims_email text not null,
|
claims_email text not null,
|
||||||
claims_email_verified boolean not null,
|
claims_email_verified boolean not null,
|
||||||
claims_groups bytea not null, -- JSON array of strings
|
claims_groups bytea not null, -- JSON array of strings
|
||||||
|
|
||||||
connector_id text not null,
|
connector_id text not null,
|
||||||
connector_data bytea,
|
|
||||||
|
|
||||||
expiry timestamptz not null
|
expiry timestamptz not null
|
||||||
);`,
|
);`,
|
||||||
`
|
`
|
||||||
|
@ -111,16 +110,15 @@ var migrations = []migration{
|
||||||
scopes bytea not null, -- JSON array of strings
|
scopes bytea not null, -- JSON array of strings
|
||||||
nonce text not null,
|
nonce text not null,
|
||||||
redirect_uri text not null,
|
redirect_uri text not null,
|
||||||
|
|
||||||
claims_user_id text not null,
|
claims_user_id text not null,
|
||||||
claims_username text not null,
|
claims_username text not null,
|
||||||
claims_email text not null,
|
claims_email text not null,
|
||||||
claims_email_verified boolean not null,
|
claims_email_verified boolean not null,
|
||||||
claims_groups bytea not null, -- JSON array of strings
|
claims_groups bytea not null, -- JSON array of strings
|
||||||
|
|
||||||
connector_id text not null,
|
connector_id text not null,
|
||||||
connector_data bytea,
|
|
||||||
|
|
||||||
expiry timestamptz not null
|
expiry timestamptz not null
|
||||||
);`,
|
);`,
|
||||||
`
|
`
|
||||||
|
@ -129,15 +127,14 @@ var migrations = []migration{
|
||||||
client_id text not null,
|
client_id text not null,
|
||||||
scopes bytea not null, -- JSON array of strings
|
scopes bytea not null, -- JSON array of strings
|
||||||
nonce text not null,
|
nonce text not null,
|
||||||
|
|
||||||
claims_user_id text not null,
|
claims_user_id text not null,
|
||||||
claims_username text not null,
|
claims_username text not null,
|
||||||
claims_email text not null,
|
claims_email text not null,
|
||||||
claims_email_verified boolean not null,
|
claims_email_verified boolean not null,
|
||||||
claims_groups bytea not null, -- JSON array of strings
|
claims_groups bytea not null, -- JSON array of strings
|
||||||
|
|
||||||
connector_id text not null,
|
connector_id text not null
|
||||||
connector_data bytea
|
|
||||||
);`,
|
);`,
|
||||||
`
|
`
|
||||||
create table password (
|
create table password (
|
||||||
|
@ -175,6 +172,7 @@ var migrations = []migration{
|
||||||
user_id text not null,
|
user_id text not null,
|
||||||
conn_id text not null,
|
conn_id text not null,
|
||||||
refresh bytea not null,
|
refresh bytea not null,
|
||||||
|
connector_data bytea not null,
|
||||||
PRIMARY KEY (user_id, conn_id)
|
PRIMARY KEY (user_id, conn_id)
|
||||||
);`,
|
);`,
|
||||||
},
|
},
|
||||||
|
|
Reference in a new issue