Coverage for mindsdb / migrations / versions / 2025-02-14_4521dafe89ab_added_encrypted_content_to_json_storage.py: 60%

15 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1"""added_encrypted_content_to_json_storage 

2 

3Revision ID: 4521dafe89ab 

4Revises: 6ab9903fc59a 

5Create Date: 2025-02-14 12:05:13.102594 

6 

7""" 

8from alembic import op 

9import sqlalchemy as sa 

10import mindsdb.interfaces.storage.db # noqa 

11 

12 

13# revision identifiers, used by Alembic. 

14revision = '4521dafe89ab' 

15down_revision = '6ab9903fc59a' 

16branch_labels = None 

17depends_on = None 

18 

19 

20def upgrade(): 

21 with op.batch_alter_table('json_storage', schema=None) as batch_op: 

22 batch_op.add_column(sa.Column('encrypted_content', sa.LargeBinary(), nullable=True)) 

23 batch_op.alter_column('resource_id', existing_type=sa.Integer(), type_=sa.BigInteger()) 

24 

25 

26def downgrade(): 

27 with op.batch_alter_table('json_storage', schema=None) as batch_op: 

28 batch_op.drop_column('encrypted_content') 

29 batch_op.alter_column('resource_id', existing_type=sa.BigInteger(), type_=sa.Integer())