##// END OF EJS Templates
artifacts: added hidden flag that will be used to store attachements for comments
bart -
r3971:fc23d267 default
parent child Browse files
Show More
@@ -0,0 +1,37 b''
1 # -*- coding: utf-8 -*-
2
3 import logging
4
5 from alembic.migration import MigrationContext
6 from alembic.operations import Operations
7 from sqlalchemy import Column, Boolean
8
9 from rhodecode.lib.dbmigrate.versions import _reset_base
10 from rhodecode.model import init_model_encryption
11
12
13 log = logging.getLogger(__name__)
14
15
16 def upgrade(migrate_engine):
17 """
18 Upgrade operations go here.
19 Don't create your own engine; bind migrate_engine to your metadata
20 """
21 _reset_base(migrate_engine)
22 from rhodecode.lib.dbmigrate.schema import db_4_16_0_2
23
24 init_model_encryption(db_4_16_0_2)
25
26 context = MigrationContext.configure(migrate_engine.connect())
27 op = Operations(context)
28
29 cache_key = db_4_16_0_2.FileStore.__table__
30
31 with op.batch_alter_table(cache_key.name) as batch_op:
32 batch_op.add_column(
33 Column('hidden', Boolean(), nullable=True, default=False))
34
35
36 def downgrade(migrate_engine):
37 pass
@@ -45,7 +45,7 b' PYRAMID_SETTINGS = {}'
45 45 EXTENSIONS = {}
46 46
47 47 __version__ = ('.'.join((str(each) for each in VERSION[:3])))
48 __dbversion__ = 99 # defines current db version for migrations
48 __dbversion__ = 100 # defines current db version for migrations
49 49 __platform__ = platform.system()
50 50 __license__ = 'AGPLv3, and Commercial License'
51 51 __author__ = 'RhodeCode GmbH'
@@ -5115,6 +5115,9 b' class FileStore(Base, BaseModel):'
5115 5115 # if repo/repo_group reference is set, check for permissions
5116 5116 check_acl = Column('check_acl', Boolean(), nullable=False, default=True)
5117 5117
5118 # hidden defines an attachement that should be hidden from showing in artifact listing
5119 hidden = Column('hidden', Boolean(), nullable=False, default=False)
5120
5118 5121 user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), nullable=False)
5119 5122 upload_user = relationship('User', lazy='joined', primaryjoin='User.user_id==FileStore.user_id')
5120 5123
General Comments 0
You need to be logged in to leave comments. Login now