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

PostrgeSQL, aerich downgrade, OperationalError: syntax error at or near "FOREIGN" #27

Closed
maxim-s-barabash opened this issue Jul 17, 2020 · 3 comments
Labels
wait feedback Wait feedback

Comments

@maxim-s-barabash
Copy link

maxim-s-barabash commented Jul 17, 2020

aerich v0.2.1

Hi. After executing the command aerich downgrade I get an error

OperationalError: syntax error at or near "FOREIGN"

cat 1_202059071720115939_user_companies.json

{
...
  "downgrade": [
    "ALTER TABLE \"user\" DROP FOREIGN KEY \"fk_user_company_e03b12ac\"",
...
  ]
}

Changes to this variant and it worked

{
...
  "downgrade": [
    "ALTER TABLE \"user\" DROP CONSTRAINT \"fk_user_company_e03b12ac\"",
...
  ]
}
@maxim-s-barabash
Copy link
Author

@moubctez, cast

@long2ice
Copy link
Member

Sorry I'm not so familiar with postgres syntax, this is fixed by 2fcb262, you can update from dev branch and try again.

@long2ice long2ice added the wait feedback Wait feedback label Jul 20, 2020
@maxim-s-barabash
Copy link
Author

It works for me. thank.

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

No branches or pull requests

2 participants