Skip to content

Commit

Permalink
postpone access token uniqueness change
Browse files Browse the repository at this point in the history
  • Loading branch information
livio-a committed May 26, 2021
1 parent 628bc78 commit 50115ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 1 addition & 4 deletions internal/user/repository/view/token_view.go
Expand Up @@ -36,10 +36,7 @@ func TokensByUserID(db *gorm.DB, table, userID string) ([]*usr_model.TokenView,
}

func PutToken(db *gorm.DB, table string, token *usr_model.TokenView) error {
save := repository.PrepareSaveOnConflict(table,
[]string{"user_id", "user_agent_id", "application_id"},
[]string{"id", "creation_date", "change_date", "expiration", "sequence", "scopes", "audience", "preferred_language"},
)
save := repository.PrepareSave(table)
return save(db, token)
}

Expand Down
2 changes: 2 additions & 0 deletions migrations/cockroach/V1.45__refresh_tokens.sql
@@ -0,0 +1,2 @@
ALTER TABLE auth.refresh_tokens ALTER COLUMN id SET NOT NULL;
ALTER TABLE auth.refresh_tokens ALTER PRIMARY KEY USING COLUMNS(id);
7 changes: 0 additions & 7 deletions migrations/cockroach/V1.45__tokens.sql

This file was deleted.

0 comments on commit 50115ee

Please sign in to comment.