Skip to content
Snippets Groups Projects
Commit 47a59042 authored by Jakub Judiny's avatar Jakub Judiny
Browse files

Added alembic script to set low_emails from group name in reporting settings (if empty).

(Redmine issue: #7556)
parent eb039d6a
No related branches found
No related tags found
No related merge requests found
"""set email in reporting settings for group name
Revision ID: 87a0d55f56d5
Revises: d76d19d30c2c
Create Date: 2023-02-21 11:00:12.434598
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '87a0d55f56d5'
down_revision = 'd76d19d30c2c'
branch_labels = None
depends_on = None
def upgrade():
op.execute("""
UPDATE settings_reporting
SET emails_low = ARRAY[groups.name]
FROM groups
WHERE
settings_reporting.emails_low = '{}' AND
groups.id = settings_reporting.group_id""")
def downgrade():
# Downgrade is not possible, but also is not necessary,
# because it doesn't break anything in the old code.
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment