Coverage for mindsdb / migrations / versions / 2023-10-03_6cb02dfd7f61_query_context.py: 82%

11 statements  

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

1"""query_context 

2 

3Revision ID: 6cb02dfd7f61 

4Revises: b0382f5be48d 

5Create Date: 2023-10-03 12:36:00.008731 

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 = '6cb02dfd7f61' 

15down_revision = 'b0382f5be48d' 

16branch_labels = None 

17depends_on = None 

18 

19 

20def upgrade(): 

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

22 op.create_table( 

23 'query_context', 

24 sa.Column('id', sa.Integer(), nullable=False), 

25 sa.Column('company_id', sa.Integer(), nullable=True), 

26 sa.Column('query', sa.String(), nullable=False), 

27 sa.Column('context_name', sa.String(), nullable=False), 

28 sa.Column('values', sa.JSON(), nullable=True), 

29 sa.Column('updated_at', sa.DateTime(), nullable=True), 

30 sa.Column('created_at', sa.DateTime(), nullable=True), 

31 sa.PrimaryKeyConstraint('id') 

32 ) 

33 

34 

35def downgrade(): 

36 

37 op.drop_table('query_context') 

38 # ### end Alembic commands ###