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

Bug when running migrations without specifying connection #288

Closed
girardinsamuel opened this issue Jan 2, 2021 · 3 comments
Closed

Bug when running migrations without specifying connection #288

girardinsamuel opened this issue Jan 2, 2021 · 3 comments

Comments

@girardinsamuel
Copy link
Contributor

Requirements:

  • masoniteorm==0.9.3
  • masonite == develop

To reproduce:

  • in config/databases.py => set default as 'postgres'.
  • run python craft migrate =>
AttributeError
  'str' object has no attribute 'get'
  at ~/.pyenv/versions/pingcrm_masonite/lib/python3.9/site-packages/masoniteorm/schema/Schema.py:120 in get_connection_information
      116│         return self._blueprint
      117│ 
      118│     def get_connection_information(self):
      119│         return {
    → 120│             "host": self.connection_details.get(self.connection, {}).get("host"),
      121│             "database": self.connection_details.get(self.connection, {}).get(
      122│                 "database"
      123│             ),
      124│             "user": self.connection_details.get(self.connection, {}).get("user"),

It's working when running python craft migrate -c postgres.

Here is the issue is that self.connection equals to default and then self.connection_details.get(self.connection, {}) equals to the string postgres.

Is this a real bug or did I use wrong versions ? 🤔

@girardinsamuel
Copy link
Contributor Author

Looks like it's working with unreleased version of masonite orm.
I installed in my project

pip install https://github.com/MasoniteFramework/orm

this version is not released and fixes this bug.

@girardinsamuel
Copy link
Contributor Author

@josephmancuso FYI

@josephmancuso
Copy link
Member

josephmancuso commented Jan 4, 2021

Released v0.9.4 which had a bunch of fixes we've been working on

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