Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate db fails when using dialect postgres #325

Open
MarkusPfundstein opened this issue Mar 26, 2023 · 1 comment
Open

migrate db fails when using dialect postgres #325

MarkusPfundstein opened this issue Mar 26, 2023 · 1 comment

Comments

@MarkusPfundstein
Copy link

Hi, when running npm run-script migrate_db and dialect postgres, the script will fail on 20210603073911-hashed-access-tokens.

I fixed it by applying the following change:

diff --git a/migrations/20210603073911-hashed-access-tokens.js b/migrations/20210603073911-hashed-access-tokens.js
index 33fbbaef..3e862d3b 100644
--- a/migrations/20210603073911-hashed-access-tokens.js
+++ b/migrations/20210603073911-hashed-access-tokens.js
@@ -23,9 +23,7 @@ module.exports = {
       }));
     }).then(() => {
       // Remove access_token as primary key
-      return queryInterface.removeConstraint('oauth_access_token', 'access_token');
-    }).then(() => {
-      return queryInterface.removeConstraint('oauth_access_token', 'PRIMARY');
+      return queryInterface.removeConstraint('oauth_access_token', 'oauth_access_token_pkey')
     }).then(() => {
       // Now that the access_token column is not a primary key
       // use an unlimited text column so JWT can be store without any problem
@apozohue10
Copy link
Contributor

Hi Markus,

if you want, you can make a PR so we can take a deep look. Just to check if your fix do not generate conflicts with other database deployments.

BR

Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants