Mercurial > kallithea
comparison rhodecode/lib/dbmigrate/versions/__init__.py @ 3148:b31984972e95 beta
Migration upgrades cache for lightweight dashboard
Fixed some migration issues
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 05 Jan 2013 02:20:35 +0100 |
parents | 89efedac4e6c |
children | cd50d1b5f35b |
comparison
equal
deleted
inserted
replaced
3147:8182ebed2922 | 3148:b31984972e95 |
---|---|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 # GNU General Public License for more details. | 21 # GNU General Public License for more details. |
22 # | 22 # |
23 # You should have received a copy of the GNU General Public License | 23 # You should have received a copy of the GNU General Public License |
24 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 24 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
25 from sqlalchemy import * | |
26 from sqlalchemy.exc import DatabaseError | |
27 from sqlalchemy.orm import relation, backref, class_mapper, joinedload | |
28 from sqlalchemy.orm.session import Session | |
29 from sqlalchemy.ext.declarative import declarative_base | |
30 | |
31 from rhodecode.lib.dbmigrate.migrate import * | |
32 from rhodecode.lib.dbmigrate.migrate.changeset import * | |
33 | |
34 from rhodecode.model.meta import Base | |
35 from rhodecode.model import meta | |
36 | |
37 | |
38 def _reset_base(migrate_engine): | |
39 ## RESET COMPLETLY THE metadata for sqlalchemy to use previous declared Base | |
40 Base = declarative_base() | |
41 Base.metadata.clear() | |
42 Base.metadata = MetaData() | |
43 Base.metadata.bind = migrate_engine | |
44 meta.Base = Base |