annotate rhodecode/lib/dbmigrate/versions/__init__.py @ 3181:efe23d6c178c rhodecode-0.0.1.5.2

merged with beta
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 21 Jan 2013 00:49:59 +0100
parents cd50d1b5f35b
children ffd45b185016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
833
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 """
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 rhodecode.lib.dbmigrate.versions.__init__
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 Package containing new versions of database models
1203
6832ef664673 source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents: 902
diff changeset
7
833
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 :created_on: Dec 11, 2010
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 :author: marcink
1824
89efedac4e6c 2012 copyrights
Marcin Kuzminski <marcin@python-works.com>
parents: 1206
diff changeset
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
833
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 :license: GPLv3, see COPYING for more details.
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 """
1206
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
13 # This program is free software: you can redistribute it and/or modify
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
14 # it under the terms of the GNU General Public License as published by
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
15 # the Free Software Foundation, either version 3 of the License, or
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
16 # (at your option) any later version.
1203
6832ef664673 source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents: 902
diff changeset
17 #
833
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 # This program is distributed in the hope that it will be useful,
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 # GNU General Public License for more details.
1203
6832ef664673 source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents: 902
diff changeset
22 #
833
9753e0907827 added dbmigrate package, added model changes
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 # You should have received a copy of the GNU General Public License
1206
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
3148
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
25 from sqlalchemy import *
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
26 from sqlalchemy.exc import DatabaseError
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
27 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
28 from sqlalchemy.orm.session import Session
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
29 from sqlalchemy.ext.declarative import declarative_base
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
30
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
31 from rhodecode.lib.dbmigrate.migrate import *
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
32 from rhodecode.lib.dbmigrate.migrate.changeset import *
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
33
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
34 from rhodecode.model.meta import Base
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
35 from rhodecode.model import meta
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
36
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
37
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
38 def _reset_base(migrate_engine):
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
39 ## RESET COMPLETLY THE metadata for sqlalchemy to use previous declared Base
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
40 Base = declarative_base()
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
41 Base.metadata.clear()
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
42 Base.metadata = MetaData()
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
43 Base.metadata.bind = migrate_engine
b31984972e95 Migration upgrades cache for lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents: 1824
diff changeset
44 meta.Base = Base