Skip to content

Commit

Permalink
fix: fix reports model
Browse files Browse the repository at this point in the history
  • Loading branch information
wavey0x committed Feb 16, 2022
1 parent 78d5e06 commit 97db955
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions yearn/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@ class Transactions(SQLModel, table=True):
date_string: str
timestamp: str
updated_timestamp: datetime
reports: List["Reports"] = Relationship(back_populates="txn")

pguser = os.environ.get('PGUSER', 'postgres')
pgpassword = os.environ.get('PGPASSWORD', 'yearn')
pghost = os.environ.get('PGHOST', 'localhost')
pgdatabase = os.environ.get('PGDATABASE', 'yearn')

dsn = f'postgresql://{pguser}:{pgpassword}@{pghost}:5432/{pgdatabase}'
reports: List["Reports"] = Relationship(back_populates="txn")

class Reports(SQLModel, table=True):
id: int = Field(primary_key=True)
Expand Down Expand Up @@ -117,10 +111,17 @@ class Reports(SQLModel, table=True):
timestamp: str
updated_timestamp: datetime



pguser = os.environ.get('PGUSER', 'postgres')
pgpassword = os.environ.get('PGPASSWORD', 'yearn')
pghost = os.environ.get('PGHOST', 'localhost')
pgdatabase = os.environ.get('PGDATABASE', 'yearn')
dsn = f'postgresql://{pguser}:{pgpassword}@{pghost}:5432/{pgdatabase}'

user = os.environ.get('POSTGRES_USER')
password = os.environ.get('POSTGRES_PASS')
host = os.environ.get('POSTGRES_HOST')

dsn = f'postgresql://{user}:{password}@{host}:5432/reports'
engine = create_engine(dsn, echo=False)

Expand Down

0 comments on commit 97db955

Please sign in to comment.