# Path: gengine/metadata.py
# def init_session(override_session=None, replace=False):
#     global DBSession
#     if DBSession.target and not replace:
#         return
#     if override_session:
#         DBSession.target = override_session
#     else:
#         DBSession.target = scoped_session(get_sessionmaker())
# 
# def init_declarative_base(override_base=None):
#     global Base
#     if Base:
#         return
#     if override_base:
#         Base = override_base
#     else:
#         convention = {
#             "ix": 'ix_%(column_0_label)s',
#             "uq": "uq_%(table_name)s_%(column_0_name)s",
#             "ck": "ck_%(table_name)s_%(constraint_name)s",
#             "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
#             "pk": "pk_%(table_name)s"
#         }
#         metadata = MetaData(naming_convention=convention)
#         Base = declarative_base(metadata = metadata)
# 
# Path: gengine/metadata.py
# class MySession(Session):
#     def commit(self,*args,**kw):
#     def rollback(self, *args, **kw):
# def get_sessionmaker(bind=None):
# def init_session(override_session=None, replace=False):
# def init_declarative_base(override_base=None):
# def init_db(engine):


from logging.config import fileConfig
from alembic import context
from gengine.metadata import init_session,init_declarative_base
from gengine.metadata import Base
from gengine.app.model import *
import os
from __future__ import with_statement



# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.

config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
if config.config_file_name:
    fileConfig(config.config_file_name)

overrides = {}

durl = os.environ.get("DATABASE_URL") #heroku
if durl:
    config.set_main_option('sqlalchemy.url',durl)

# add your model's MetaData object here
# for 'autogenerate' support
init_session()

# Path: gengine/metadata.py
# def init_session(override_session=None, replace=False):
#     global DBSession
#     if DBSession.target and not replace:
#         return
#     if override_session:
#         DBSession.target = override_session
#     else:
#         DBSession.target = scoped_session(get_sessionmaker())
# 
# def init_declarative_base(override_base=None):
#     global Base
#     if Base:
#         return
#     if override_base:
#         Base = override_base
#     else:
#         convention = {
#             "ix": 'ix_%(column_0_label)s',
#             "uq": "uq_%(table_name)s_%(column_0_name)s",
#             "ck": "ck_%(table_name)s_%(constraint_name)s",
#             "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
#             "pk": "pk_%(table_name)s"
#         }
#         metadata = MetaData(naming_convention=convention)
#         Base = declarative_base(metadata = metadata)
# 
# Path: gengine/metadata.py
# class MySession(Session):
#     def commit(self,*args,**kw):
#     def rollback(self, *args, **kw):
# def get_sessionmaker(bind=None):
# def init_session(override_session=None, replace=False):
# def init_declarative_base(override_base=None):
# def init_db(engine):


# Path: gengine/app/alembic/env.py
from logging.config import fileConfig
from alembic import context
from gengine.metadata import init_session,init_declarative_base
from gengine.metadata import Base
from gengine.app.model import *
import os

from __future__ import with_statement



# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.

config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
if config.config_file_name:
    fileConfig(config.config_file_name)

overrides = {}

durl = os.environ.get("DATABASE_URL") #heroku
if durl:
    config.set_main_option('sqlalchemy.url',durl)

# add your model's MetaData object here
# for 'autogenerate' support
init_session()

init_declarative_base()