|
@@ -11,13 +11,11 @@ from sqlalchemy.orm import sessionmaker
|
|
|
from sqlalchemy.pool import QueuePool
|
|
|
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
|
|
|
|
|
|
-DBHOSTNAME = os.environ.get('DBHOST', 'localhost')
|
|
|
-
|
|
|
def get_conn():
|
|
|
return psycopg2.connect(
|
|
|
user = 'benchmarkdbuser',
|
|
|
password = 'benchmarkdbpass',
|
|
|
- host = DBHOSTNAME,
|
|
|
+ host = 'TFB-database',
|
|
|
port = '5432',
|
|
|
database = 'hello_world'
|
|
|
)
|
|
@@ -49,7 +47,7 @@ class SQLAlchemyEncoder(json.JSONEncoder):
|
|
|
|
|
|
|
|
|
class World(DatabaseBase):
|
|
|
- __tablename__ = 'World'
|
|
|
+ __tablename__ = 'world'
|
|
|
|
|
|
id = Column('id', Integer, primary_key=True)
|
|
|
randomNumber = Column('randomnumber', Integer, nullable=False, server_default='0')
|
|
@@ -59,7 +57,7 @@ class World(DatabaseBase):
|
|
|
|
|
|
|
|
|
class Fortune(DatabaseBase):
|
|
|
- __tablename__ = 'Fortune'
|
|
|
+ __tablename__ = 'fortune'
|
|
|
|
|
|
id = Column('id', Integer, primary_key=True)
|
|
|
message = Column('message', String, nullable=False)
|