Coverage for mindsdb / migrations / versions / 2022-01-26_47f97b83cee4_views.py: 82%

11 statements  

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

1"""views 

2 

3Revision ID: 47f97b83cee4 

4Revises: 17c3d2384711 

5Create Date: 2022-01-26 12:07:05.075977 

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 = '47f97b83cee4' 

15down_revision = '17c3d2384711' 

16branch_labels = None 

17depends_on = None 

18 

19 

20def upgrade(): 

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

22 op.create_table( 

23 'view', 

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

25 sa.Column('name', sa.String(), nullable=False), 

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

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

28 sa.Column('datasource_id', sa.Integer(), nullable=False), 

29 sa.ForeignKeyConstraint(['datasource_id'], ['datasource.id'], ), 

30 sa.PrimaryKeyConstraint('id') 

31 ) 

32 # ### end Alembic commands ### 

33 

34 

35def downgrade(): 

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

37 op.drop_table('view') 

38 # ### end Alembic commands ###