annotate rhodecode/lib/dbmigrate/versions/009_version_1_5_1.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 102ef3f1b849
children 7e5f8c12a3fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3101
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 import logging
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 import datetime
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 from sqlalchemy import *
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 from sqlalchemy.exc import DatabaseError
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 from sqlalchemy.orm.session import Session
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 from sqlalchemy.ext.declarative import declarative_base
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 from rhodecode.lib.dbmigrate.migrate import *
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 from rhodecode.lib.dbmigrate.migrate.changeset import *
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 from rhodecode.model.meta import Base
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 from rhodecode.model import meta
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 log = logging.getLogger(__name__)
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 def upgrade(migrate_engine):
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 """
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 Upgrade operations go here.
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 Don't create your own engine; bind migrate_engine to your metadata
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 """
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 pass
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 def downgrade(migrate_engine):
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 meta = MetaData()
102ef3f1b849 default permissions can get duplicated after migration from 1.4.X. check and verify again it, notify user that he should re-check it.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 meta.bind = migrate_engine