aqueduct db upgrade cannot connect to database

374 views Asked by At

I have problem with connecting my aqueduct server to postgres database. Informations and things i have done:

  • postgres version is 13.0
  • system is Windows 10
  • I am using AndroidStudio and internal terminal
  • aqueduct version is 3.3.0+1
  • created migration files using aqueduct db generate
  • I am able to connect to database using psql shell
  • created user lit_test_user
  • created database 'lit_test' and GRANTED ALL ON lit_test_user

In postgresql.conf set

listen_addresses = '*'
port = 5432

In pg_hba.conf added lines

host    all             all             0.0.0.0/0               md5
host    all             all             ::0/0                   md5

Now I want to connect to my database with command:

aqueduct db upgrade --connect postgres://lit_test_user:czinczolada123@localhost:5432/lit_test

Error I get is: There was an error connecting to the database 'lit_test_user:czinczolada123@localhost:5432/lit_test'. Reason: unable to connect to database.
I don't know what I did wrong, because using psql shell connects just fine.

1

There are 1 answers

0
Spasibo On BEST ANSWER

I rolled back the version of PostgreSQL to 10.14. It's stable.

And pubspec.yaml I changed to this:

dependencies:
  aqueduct: ^4.0.0-b1

dev_dependencies:
  test: ^1.0.0
  aqueduct_test: ^2.0.0-b1

BUT IMPORTANT. Enter the command: pub global activate aqueduct 4.0.0-b1