| Line 687... |
Line 687... |
| 687 |
status = Field(String(512))
|
687 |
status = Field(String(512))
|
| 688 |
created = Field(DateTime, default=func.now())
|
688 |
created = Field(DateTime, default=func.now())
|
| 689 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
689 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 690 |
using_options(shortnames=True)
|
690 |
using_options(shortnames=True)
|
| 691 |
using_table_options(mysql_engine="InnoDB")
|
691 |
using_table_options(mysql_engine="InnoDB")
|
| 692 |
|
692 |
#it runs through the proxy
|
| 693 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True, setup=True):
|
693 |
def initialize(dbname='dtr', db_hostname="127.0.0.1", echo=True, setup=True):
|
| 694 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
694 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 695 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
695 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 696 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
696 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 697 |
metadata.bind = cengine
|
697 |
metadata.bind = cengine
|
| 698 |
metadata.bind.echo = echo
|
698 |
metadata.bind.echo = echo
|