Coverage for mindsdb / migrations / versions / 2024-07-09_bfc6f44f5bc9_agent_model_optional.py: 53%

17 statements  

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

1"""agent_model_optional 

2 

3Revision ID: bfc6f44f5bc9 

4Revises: 2958416fbe75 

5Create Date: 2024-07-09 14:50:40.193842 

6 

7""" 

8from alembic import op 

9import sqlalchemy as sa 

10import mindsdb.interfaces.storage.db # noqa 

11 

12# revision identifiers, used by Alembic. 

13revision = 'bfc6f44f5bc9' 

14down_revision = 'cbedc4968d5d' 

15branch_labels = None 

16depends_on = None 

17 

18 

19def upgrade(): 

20 # ### commands auto generated by Alembic - please adjust! ### 

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

22 batch_op.alter_column( 

23 'model_name', 

24 existing_type=sa.VARCHAR(), 

25 nullable=True 

26 ) 

27 

28 with op.batch_alter_table('chat_bots', schema=None) as batch_op: 

29 batch_op.alter_column( 

30 'model_name', 

31 existing_type=sa.VARCHAR(), 

32 nullable=True 

33 ) 

34 

35 

36def downgrade(): 

37 

38 with op.batch_alter_table('chat_bots', schema=None) as batch_op: 

39 batch_op.alter_column( 

40 'model_name', 

41 existing_type=sa.VARCHAR(), 

42 nullable=False 

43 ) 

44 

45 with op.batch_alter_table('agents', schema=None) as batch_op: 

46 batch_op.alter_column( 

47 'model_name', 

48 existing_type=sa.VARCHAR(), 

49 nullable=False 

50 )