annotate rhodecode/lib/dbmigrate/versions/011_version_1_6_0.py @ 3700:3563bb7b4b82

merge with rc1
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 07 Apr 2013 18:37:22 +0200
parents b3cf4539d1bd
children ffd45b185016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3309
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 import logging
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 import datetime
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 from sqlalchemy import *
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 from sqlalchemy.exc import DatabaseError
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 from sqlalchemy.orm import relation, backref, class_mapper, joinedload
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 from sqlalchemy.orm.session import Session
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 from sqlalchemy.ext.declarative import declarative_base
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 from rhodecode.lib.dbmigrate.migrate import *
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 from rhodecode.lib.dbmigrate.migrate.changeset import *
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 from rhodecode.model.meta import Base
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 from rhodecode.model import meta
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 from rhodecode.lib.dbmigrate.versions import _reset_base
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 log = logging.getLogger(__name__)
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 def upgrade(migrate_engine):
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 """
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 Upgrade operations go here.
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 Don't create your own engine; bind migrate_engine to your metadata
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 """
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 _reset_base(migrate_engine)
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 #==========================================================================
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 # USER LOGS
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 #==========================================================================
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 from rhodecode.lib.dbmigrate.schema.db_1_6_0 import RepositoryField
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 tbl = RepositoryField.__table__
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 tbl.create()
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 def downgrade(migrate_engine):
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 meta = MetaData()
b3cf4539d1bd Added missing migrations, and move update_repoinfo to RepoModel
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 meta.bind = migrate_engine