# Path: suma/core/models/meta/base.py
# class Base(object):
#     @declared_attr
#     def __tablename__(cls):
#         return _camel_to_snake(cls.__name__)
# 
#     __table_args__ = {'schema': 'suma'}
# 
#     id = Column(Integer, primary_key=True)
# 
# def create_dbsession(engine):
#     dbsession = scoped_session(sessionmaker())
#     dbsession.configure(bind=engine)
#     Base.metadata.bind = engine
#     return dbsession


import os
import sys
from alembic.config import Config
from alembic import command
from sqlalchemy import engine_from_config
from pyramid.paster import (
    get_appsettings,
    setup_logging,
    )
from suma.core.models.meta import (
    Base,
    create_dbsession
    )





def usage(argv):
    cmd = os.path.basename(argv[0])
    print('usage: %s <config_uri>\n'
          '(example: "%s development.ini")' % (cmd, cmd))
    sys.exit(1)


def main(argv=sys.argv):
    if len(argv) != 2:

# Path: suma/core/models/meta/base.py
# class Base(object):
#     @declared_attr
#     def __tablename__(cls):
#         return _camel_to_snake(cls.__name__)
# 
#     __table_args__ = {'schema': 'suma'}
# 
#     id = Column(Integer, primary_key=True)
# 
# def create_dbsession(engine):
#     dbsession = scoped_session(sessionmaker())
#     dbsession.configure(bind=engine)
#     Base.metadata.bind = engine
#     return dbsession


# Path: suma/core/scripts/initializedb.py
import os
import sys
from alembic.config import Config
from alembic import command
from sqlalchemy import engine_from_config
from pyramid.paster import (
    get_appsettings,
    setup_logging,
    )
from suma.core.models.meta import (
    Base,
    create_dbsession
    )






def usage(argv):
    cmd = os.path.basename(argv[0])
    print('usage: %s <config_uri>\n'
          '(example: "%s development.ini")' % (cmd, cmd))
    sys.exit(1)


def main(argv=sys.argv):
    if len(argv) != 2:

        usage(argv)