Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin-Sun-tts committed Mar 19, 2024
1 parent b67dd4a commit eb136bd
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions migrations/versions/701baacbc2f2_base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,84 @@ def upgrade():
op.create_table('organization',
sa.Column('name', sa.String(), nullable=False),
sa.Column('logo', sa.String(), nullable=True),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'),
nullable=False),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('organization', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_organization_name'), ['name'], unique=False)
batch_op.create_index(batch_op.f('ix_organization_name'),
['name'], unique=False)

op.create_table('harvest_source',
sa.Column('name', sa.String(), nullable=False),
sa.Column('notification_emails', postgresql.ARRAY(sa.String()), nullable=True),
sa.Column('notification_emails', postgresql.ARRAY(sa.String()),
nullable=True),
sa.Column('organization_id', sa.UUID(), nullable=False),
sa.Column('frequency', sa.String(), nullable=False),
sa.Column('url', sa.String(), nullable=False),
sa.Column('schema_type', sa.String(), nullable=False),
sa.Column('source_type', sa.String(), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'),
nullable=False),
sa.ForeignKeyConstraint(['organization_id'], ['organization.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('url')
)
op.create_table('harvest_job',
sa.Column('harvest_source_id', sa.UUID(), nullable=False),
sa.Column('status', sa.Enum('new', 'in_progress', 'complete', name='job_status'), nullable=False),
sa.Column('status', sa.Enum('new', 'in_progress', 'complete',
name='job_status'), nullable=False),
sa.Column('date_created', sa.DateTime(), nullable=True),
sa.Column('date_finished', sa.DateTime(), nullable=True),
sa.Column('records_added', sa.Integer(), nullable=True),
sa.Column('records_updated', sa.Integer(), nullable=True),
sa.Column('records_deleted', sa.Integer(), nullable=True),
sa.Column('records_errored', sa.Integer(), nullable=True),
sa.Column('records_ignored', sa.Integer(), nullable=True),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'),
nullable=False),
sa.ForeignKeyConstraint(['harvest_source_id'], ['harvest_source.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('harvest_job', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_harvest_job_date_created'), ['date_created'], unique=False)
batch_op.create_index(batch_op.f('ix_harvest_job_status'), ['status'], unique=False)
batch_op.create_index(batch_op.f('ix_harvest_job_date_created'),
['date_created'], unique=False)
batch_op.create_index(batch_op.f('ix_harvest_job_status'),
['status'], unique=False)

op.create_table('harvest_error',
sa.Column('harvest_job_id', sa.UUID(), nullable=False),
sa.Column('harvest_record_id', sa.String(), nullable=True),
sa.Column('date_created', sa.DateTime(), nullable=True),
sa.Column('type', sa.String(), nullable=True),
sa.Column('severity', sa.Enum('CRITICAL', 'ERROR', 'WARN', name='error_serverity'), nullable=False),
sa.Column('severity', sa.Enum('CRITICAL', 'ERROR', 'WARN',
name='error_serverity'), nullable=False),
sa.Column('message', sa.String(), nullable=True),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'),
nullable=False),
sa.ForeignKeyConstraint(['harvest_job_id'], ['harvest_job.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('harvest_error', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_harvest_error_severity'), ['severity'], unique=False)
batch_op.create_index(batch_op.f('ix_harvest_error_severity'),
['severity'], unique=False)

op.create_table('harvest_record',
sa.Column('job_id', sa.UUID(), nullable=False),
sa.Column('identifier', sa.String(), nullable=False),
sa.Column('ckan_id', sa.String(), nullable=False),
sa.Column('type', sa.String(), nullable=False),
sa.Column('source_metadata', sa.String(), nullable=True),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'), nullable=False),
sa.Column('id', sa.UUID(), server_default=sa.text('gen_random_uuid()'),
nullable=False),
sa.ForeignKeyConstraint(['job_id'], ['harvest_job.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('harvest_record', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_harvest_record_ckan_id'), ['ckan_id'], unique=False)
batch_op.create_index('ix_job_id_identifier', ['job_id', 'identifier'], unique=False)
batch_op.create_index(batch_op.f('ix_harvest_record_ckan_id'),
['ckan_id'], unique=False)
batch_op.create_index('ix_job_id_identifier',
['job_id', 'identifier'], unique=False)

# ### end Alembic commands ###

Expand Down

1 comment on commit eb136bd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
harvester
   __init__.py50100% 
   ckan_utils.py4222 95%
   exceptions.py420100% 
   harvest.py4256565 85%
   logger_config.py10100% 
   utils.py3522 94%
TOTAL5506987% 

Tests Skipped Failures Errors Time
28 0 💤 0 ❌ 0 🔥 2.048s ⏱️

Please sign in to comment.