Coverage for mindsdb / migrations / versions / 2024-04-25_2958416fbe75_drop_semaphor.py: 82%

11 statements  

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

1"""drop-semaphor 

2 

3Revision ID: 2958416fbe75 

4Revises: 9461892bd889 

5Create Date: 2024-04-25 18:30:54.051212 

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 = '2958416fbe75' 

15down_revision = '9461892bd889' 

16branch_labels = None 

17depends_on = None 

18 

19 

20def upgrade(): 

21 op.drop_table('semaphor') 

22 

23 

24def downgrade(): 

25 op.create_table( 

26 'semaphor', 

27 sa.Column('id', sa.INTEGER(), nullable=False), 

28 sa.Column('updated_at', sa.DATETIME(), nullable=True), 

29 sa.Column('created_at', sa.DATETIME(), nullable=True), 

30 sa.Column('entity_type', sa.VARCHAR(), nullable=True), 

31 sa.Column('entity_id', sa.INTEGER(), nullable=True), 

32 sa.Column('action', sa.VARCHAR(), nullable=True), 

33 sa.Column('company_id', sa.INTEGER(), nullable=True), 

34 sa.PrimaryKeyConstraint('id'), 

35 sa.UniqueConstraint('entity_type', 'entity_id', name='uniq_const') 

36 )