def setUp(self):
        super(SchemaTest, self).setUp()
        sqlite_path = self.make_path("")
        self.database = create_database("sqlite:///%s" % sqlite_path)
        self.store = Store(self.database)
        self.patch_table = "my_patch_table"

        self.package = self.create_package(self.make_path(), "patch_package")
        # patch_package is created during the tests and is not around during
        # lint checks, so we'll diable the error
        import patch_package

        creates = ["CREATE TABLE person (id INTEGER, name TEXT)"]
        drops = ["DROP TABLE person"]
        deletes = ["DELETE FROM person"]

        self.schema = Schema(creates, drops, deletes, patch_package,
                             self.patch_table)
示例#2
0
def create_schema():
    """Return a Schema"""
    from backends.db.schemas import txlog as patch_package
    return Schema(CREATE, DROP, DELETE, patch_package, 'txlog.patch')
示例#3
0
def create_schema():
    '''Creates the Schema with all the instructions.'''
    # We pass this very package to schema, so we need to reimport ourselves
    from backends.db.schemas import fsync_main as patch_package
    return Schema(CREATE, DROP, DELETE, patch_package, 'patch_main')
示例#4
0
def create_schema():
    """Return a Schema"""
    from backends.db.schemas import account as patch_package
    return Schema(CREATE, DROP, DELETE, patch_package, 'account2.patch')
示例#5
0
def create_schema():
    """Returns a Schema"""
    from backends.db.schemas import auth as patch_package
    return Schema(CREATE, DROP, DELETE, patch_package, 'public.patch')