"Fossies" - the Fresh Open Source Software Archive

Member "indico-2.2.5/indico/migrations/versions/20190809_1711_620b312814f3_migrate_indico_weeks_view_theme_name.py" (6 Dec 2019, 752 Bytes) of package /linux/www/indico-2.2.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "20190809_1711_620b312814f3_migrate_indico_weeks_view_theme_name.py" see the Fossies "Dox" file reference documentation.

    1 """Migrate indico-weeks-view theme name
    2 
    3 Revision ID: 620b312814f3
    4 Revises: 06a4ec717b84
    5 Create Date: 2019-08-09 17:11:55.699189
    6 """
    7 
    8 from alembic import op
    9 
   10 
   11 # revision identifiers, used by Alembic.
   12 revision = '620b312814f3'
   13 down_revision = '06a4ec717b84'
   14 branch_labels = None
   15 depends_on = None
   16 
   17 
   18 def upgrade():
   19     op.execute('''
   20         UPDATE events.settings
   21         SET value = '"indico_weeks_view"'::json
   22         WHERE module = 'layout' AND name = 'timetable_theme' AND value #>> '{}' = 'indico-weeks-view';
   23     ''')
   24 
   25 
   26 def downgrade():
   27     op.execute('''
   28         UPDATE events.settings
   29         SET value = '"indico-weeks-view"'::json
   30         WHERE module = 'layout' AND name = 'timetable_theme' AND value #>> '{}' = 'indico_weeks_view';
   31     ''')