コード例 #1
0
ファイル: manage.py プロジェクト: ynwssjx/masakari
 def sync(self, version=None):
     """Sync the database up to the most recent version."""
     try:
         return db_migration.db_sync(version)
     except exception.InvalidInput as ex:
         print(ex)
         sys.exit(1)
コード例 #2
0
ファイル: manage.py プロジェクト: rkmrHonjo/masakari
 def sync(self, version=None):
     """Sync the database up to the most recent version."""
     try:
         return db_migration.db_sync(version)
     except exception.InvalidInput as ex:
         print(ex)
         sys.exit(1)
コード例 #3
0
    def test_innodb_tables(self):
        sa_migration.db_sync(engine=self.migrate_engine)

        total = self.migrate_engine.execute(
            "SELECT count(*) "
            "FROM information_schema.TABLES "
            "WHERE TABLE_SCHEMA = '%(database)s'" %
            {'database': self.migrate_engine.url.database})
        self.assertGreater(total.scalar(), 0, "No tables found. Wrong schema?")

        noninnodb = self.migrate_engine.execute(
            "SELECT count(*) "
            "FROM information_schema.TABLES "
            "WHERE TABLE_SCHEMA='%(database)s' "
            "AND ENGINE != 'InnoDB' "
            "AND TABLE_NAME != 'migrate_version'" %
            {'database': self.migrate_engine.url.database})
        count = noninnodb.scalar()
        self.assertEqual(count, 0, "%d non InnoDB tables created" % count)
コード例 #4
0
ファイル: test_migrations.py プロジェクト: openstack/masakari
    def test_innodb_tables(self):
        sa_migration.db_sync(engine=self.migrate_engine)

        total = self.migrate_engine.execute(
            "SELECT count(*) "
            "FROM information_schema.TABLES "
            "WHERE TABLE_SCHEMA = '%(database)s'" %
            {'database': self.migrate_engine.url.database})
        self.assertGreater(total.scalar(), 0, "No tables found. Wrong schema?")

        noninnodb = self.migrate_engine.execute(
            "SELECT count(*) "
            "FROM information_schema.TABLES "
            "WHERE TABLE_SCHEMA='%(database)s' "
            "AND ENGINE != 'InnoDB' "
            "AND TABLE_NAME != 'migrate_version'" %
            {'database': self.migrate_engine.url.database})
        count = noninnodb.scalar()
        self.assertEqual(count, 0, "%d non InnoDB tables created" % count)
コード例 #5
0
 def db_sync(self, engine):
     sa_migration.db_sync(engine=self.migrate_engine)
コード例 #6
0
ファイル: test_migrations.py プロジェクト: openstack/masakari
 def db_sync(self, engine):
     sa_migration.db_sync(engine=self.migrate_engine)