Python sqlalchemy.schema 模块,CreateIndex() 实例源码

我们从Python开源项目中,提取了以下26个代码示例,用于说明如何使用sqlalchemy.schema.CreateIndex()

项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def create_table(self):

        if not self.schema:
            self.schema = DB_ETL_SCHEMA

        if not self.create_schema():
            return False

        logger.info('try to create table {} in {}'.format(
            self.sql_table_name,
            self.schema
        ))

        if self.exist_table():
            return True

        table = self.get_sql_table_object(need_columns=True)

        db_table = self.local_engine.execute(CreateTable(table))

        for index in table.indexes:
            self.local_engine.execute(CreateIndex(index))

        return db_table
项目:osm-wikidata    作者:EdwardBetts    | 项目源码 | 文件源码
def print_create_table(tables):
    app.config.from_object('config.default')
    database.init_app(app)

    engine = database.session.get_bind()

    for class_name in tables:
        cls = get_class(class_name)

        for c in cls.__table__.columns:
            if not isinstance(c.type, Enum):
                continue
            t = c.type
            sql = str(CreateEnumType(t).compile(engine))
            click.echo(sql.strip() + ';')

        for index in cls.__table__.indexes:
            sql = str(CreateIndex(index).compile(engine))
            click.echo(sql.strip() + ';')

        sql = str(CreateTable(cls.__table__).compile(engine))
        click.echo(sql.strip() + ';')
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                        checkfirst=False,
                                            _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                            _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                        checkfirst=False,
                                            _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                            _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:Callandtext    作者:iaora    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:Callandtext    作者:iaora    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:QualquerMerdaAPI    作者:tiagovizoto    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:QualquerMerdaAPI    作者:tiagovizoto    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:gardenbot    作者:GoestaO    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:gardenbot    作者:GoestaO    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def create_table(self, table):
        if util.sqla_07:
            table.dispatch.before_create(table, self.connection,
                                         checkfirst=False,
                                         _ddl_runner=self)
        self._exec(schema.CreateTable(table))
        if util.sqla_07:
            table.dispatch.after_create(table, self.connection,
                                        checkfirst=False,
                                        _ddl_runner=self)
        for index in table.indexes:
            self._exec(schema.CreateIndex(index))
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def create_index(self, index):
        self._exec(schema.CreateIndex(index))