25 lines
660 B
Python
25 lines
660 B
Python
"""Mail salt security fix — add password_salt column to mail_accounts.
|
|
|
|
Revision ID: 0026
|
|
Revises: 0025_entity_history
|
|
Create Date: 2026-07-23
|
|
|
|
Existing accounts get an empty salt and will use the legacy hardcoded salt
|
|
for backward compatibility. New accounts and password changes will use
|
|
per-account random salts.
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "0026_mail_salt_security"
|
|
down_revision = "0025_entity_history"
|
|
|
|
|
|
def upgrade():
|
|
op.execute("ALTER TABLE IF EXISTS mail_accounts ADD COLUMN IF NOT EXISTS password_salt VARCHAR(64) NOT NULL DEFAULT ''")
|
|
|
|
|
|
def downgrade():
|
|
op.drop_column("mail_accounts", "password_salt")
|