Coverage for mindsdb / migrations / versions / 2025-10-24_54ed56beb47a_convert_company_id_to_string.py: 57%
61 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
1"""convert_company_id_to_string
3Revision ID: 54ed56beb47a
4Revises: 608e376c19a7
5Create Date: 2025-10-24 15:05:30.187143
7"""
9from alembic import op
10import sqlalchemy as sa
11import mindsdb.interfaces.storage.db # noqa
14# revision identifiers, used by Alembic.
15revision = "54ed56beb47a"
16down_revision = "608e376c19a7"
17branch_labels = None
18depends_on = None
21def upgrade():
22 # ### commands auto generated by Alembic - please adjust! ###
23 with op.batch_alter_table("agents", schema=None) as batch_op:
24 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
26 with op.batch_alter_table("file", schema=None) as batch_op:
27 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
29 with op.batch_alter_table("integration", schema=None) as batch_op:
30 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
32 with op.batch_alter_table("jobs", schema=None) as batch_op:
33 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
35 with op.batch_alter_table("jobs_history", schema=None) as batch_op:
36 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
38 with op.batch_alter_table("json_storage", schema=None) as batch_op:
39 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
41 with op.batch_alter_table("llm_log", schema=None) as batch_op:
42 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False)
44 with op.batch_alter_table("predictor", schema=None) as batch_op:
45 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
47 with op.batch_alter_table("project", schema=None) as batch_op:
48 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
50 with op.batch_alter_table("queries", schema=None) as batch_op:
51 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
53 with op.batch_alter_table("query_context", schema=None) as batch_op:
54 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
56 with op.batch_alter_table("tasks", schema=None) as batch_op:
57 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
59 with op.batch_alter_table("view", schema=None) as batch_op:
60 batch_op.alter_column("company_id", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=True)
62 # ### end Alembic commands ###
65def downgrade():
66 # ### commands auto generated by Alembic - please adjust! ###
67 with op.batch_alter_table("view", schema=None) as batch_op:
68 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
70 with op.batch_alter_table("tasks", schema=None) as batch_op:
71 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
73 with op.batch_alter_table("query_context", schema=None) as batch_op:
74 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
76 with op.batch_alter_table("queries", schema=None) as batch_op:
77 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
79 with op.batch_alter_table("project", schema=None) as batch_op:
80 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
82 with op.batch_alter_table("predictor", schema=None) as batch_op:
83 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
85 with op.batch_alter_table("llm_log", schema=None) as batch_op:
86 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False)
88 with op.batch_alter_table("json_storage", schema=None) as batch_op:
89 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
91 with op.batch_alter_table("jobs_history", schema=None) as batch_op:
92 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
94 with op.batch_alter_table("jobs", schema=None) as batch_op:
95 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
97 with op.batch_alter_table("integration", schema=None) as batch_op:
98 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
100 with op.batch_alter_table("file", schema=None) as batch_op:
101 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
103 with op.batch_alter_table("agents", schema=None) as batch_op:
104 batch_op.alter_column("company_id", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=True)
106 # ### end Alembic commands ###