##// END OF EJS Templates
sync sqlalchemy migrate with latest changes
marcink -
r3767:e203cd36 beta
parent child Browse files
Show More
@@ -7,7 +7,7 import logging
7 from sqlalchemy import (Table, Column, MetaData, String, Text, Integer,
7 from sqlalchemy import (Table, Column, MetaData, String, Text, Integer,
8 create_engine)
8 create_engine)
9 from sqlalchemy.sql import and_
9 from sqlalchemy.sql import and_
10 from sqlalchemy import exceptions as sa_exceptions
10 from sqlalchemy import exc as sa_exceptions
11 from sqlalchemy.sql import bindparam
11 from sqlalchemy.sql import bindparam
12
12
13 from rhodecode.lib.dbmigrate.migrate import exceptions
13 from rhodecode.lib.dbmigrate.migrate import exceptions
@@ -20,6 +20,7 from rhodecode.lib.dbmigrate.migrate.ver
20
20
21 log = logging.getLogger(__name__)
21 log = logging.getLogger(__name__)
22
22
23
23 class ControlledSchema(object):
24 class ControlledSchema(object):
24 """A database under version control"""
25 """A database under version control"""
25
26
@@ -10,6 +10,7 from sqlalchemy.types import Float
10
10
11 log = logging.getLogger(__name__)
11 log = logging.getLogger(__name__)
12
12
13
13 def getDiffOfModelAgainstDatabase(metadata, engine, excludeTables=None):
14 def getDiffOfModelAgainstDatabase(metadata, engine, excludeTables=None):
14 """
15 """
15 Return differences of model against database.
16 Return differences of model against database.
@@ -17,7 +18,8 def getDiffOfModelAgainstDatabase(metada
17 :return: object which will evaluate to :keyword:`True` if there \
18 :return: object which will evaluate to :keyword:`True` if there \
18 are differences else :keyword:`False`.
19 are differences else :keyword:`False`.
19 """
20 """
20 db_metadata = sqlalchemy.MetaData(engine, reflect=True)
21 db_metadata = sqlalchemy.MetaData(engine)
22 db_metadata.reflect()
21
23
22 # sqlite will include a dynamically generated 'sqlite_sequence' table if
24 # sqlite will include a dynamically generated 'sqlite_sequence' table if
23 # there are autoincrement sequences in the database; this should not be
25 # there are autoincrement sequences in the database; this should not be
General Comments 0
You need to be logged in to leave comments. Login now