Coverage for mindsdb / migrations / versions / 2023-02-02_b6d0a47294ac_jobs.py: 69%
13 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"""jobs
3Revision ID: b6d0a47294ac
4Revises: 459218b0844c
5Create Date: 2023-02-02 11:33:06.283055
7"""
8from alembic import op
9import sqlalchemy as sa
10import mindsdb.interfaces.storage.db # noqa
12# revision identifiers, used by Alembic.
13revision = 'b6d0a47294ac'
14down_revision = '459218b0844c'
15branch_labels = None
16depends_on = None
19def upgrade():
20 # ### commands auto generated by Alembic - please adjust! ###
21 op.create_table(
22 'jobs_history',
23 sa.Column('id', sa.Integer(), nullable=False),
24 sa.Column('company_id', sa.Integer(), nullable=True),
25 sa.Column('job_id', sa.Integer(), nullable=True),
26 sa.Column('start_at', sa.DateTime(), nullable=True),
27 sa.Column('end_at', sa.DateTime(), nullable=True),
28 sa.Column('error', sa.String(), nullable=True),
29 sa.Column('created_at', sa.DateTime(), nullable=True),
30 sa.PrimaryKeyConstraint('id'),
31 sa.UniqueConstraint('job_id', 'start_at', name='uniq_job_history_job_id_start')
32 )
33 op.create_table(
34 'jobs',
35 sa.Column('id', sa.Integer(), nullable=False),
36 sa.Column('company_id', sa.Integer(), nullable=True),
37 sa.Column('name', sa.String(), nullable=False),
38 sa.Column('project_id', sa.Integer(), nullable=False),
39 sa.Column('query_str', sa.String(), nullable=False),
40 sa.Column('start_at', sa.DateTime(), nullable=True),
41 sa.Column('end_at', sa.DateTime(), nullable=True),
42 sa.Column('next_run_at', sa.DateTime(), nullable=True),
43 sa.Column('schedule_str', sa.String(), nullable=True),
44 sa.Column('deleted_at', sa.DateTime(), nullable=True),
45 sa.Column('updated_at', sa.DateTime(), nullable=True),
46 sa.Column('created_at', sa.DateTime(), nullable=True),
47 sa.PrimaryKeyConstraint('id')
48 )
49 # ### end Alembic commands ###
52def downgrade():
53 # ### commands auto generated by Alembic - please adjust! ###
54 op.drop_table('jobs')
55 op.drop_table('jobs_history')
56 # ### end Alembic commands ###