from projex.lazymodule import lazy_import
from ..psqlconnection import PSQLStatement

orb = lazy_import('orb')


class ENABLE_INTERNALS(PSQLStatement):
    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};' \
                   u'SET foreign_key_checks={0}'.format(int(enabled))

        return sql, {}


PSQLStatement.registerAddon('ENABLE INTERNALS', ENABLE_INTERNALS())

c1c337f17da4db3d86c5c8a88e45edec809a3dea
<mask token>


class ENABLE_INTERNALS(PSQLStatement):

    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().
                dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};SET foreign_key_checks={0}'.format(
                int(enabled))
        return sql, {}


<mask token>

<mask token>


class ENABLE_INTERNALS(PSQLStatement):

    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().
                dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};SET foreign_key_checks={0}'.format(
                int(enabled))
        return sql, {}


PSQLStatement.registerAddon('ENABLE INTERNALS', ENABLE_INTERNALS())

<mask token>
orb = lazy_import('orb')


class ENABLE_INTERNALS(PSQLStatement):

    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().
                dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};SET foreign_key_checks={0}'.format(
                int(enabled))
        return sql, {}


PSQLStatement.registerAddon('ENABLE INTERNALS', ENABLE_INTERNALS())

from projex.lazymodule import lazy_import
from ..psqlconnection import PSQLStatement
orb = lazy_import('orb')


class ENABLE_INTERNALS(PSQLStatement):

    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().
                dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};SET foreign_key_checks={0}'.format(
                int(enabled))
        return sql, {}


PSQLStatement.registerAddon('ENABLE INTERNALS', ENABLE_INTERNALS())

from projex.lazymodule import lazy_import
from ..psqlconnection import PSQLStatement

orb = lazy_import('orb')


class ENABLE_INTERNALS(PSQLStatement):
    def __call__(self, model=None, enabled=True):
        if model is not None:
            sql = u'ALTER TABLE "{0}" {1} KEYS;'.format(model.schema().dbname(), 'ENABLE' if enabled else 'DISABLE')
        else:
            sql = u'SET unique_checks={0};' \
                   u'SET foreign_key_checks={0}'.format(int(enabled))

        return sql, {}


PSQLStatement.registerAddon('ENABLE INTERNALS', ENABLE_INTERNALS())
