Remove the foreign key constraint from the kind field on the logentry3 table

This commit is contained in:
Joseph Schorr 2019-01-04 13:35:14 -05:00
parent e309508776
commit c510759df3
2 changed files with 1 additions and 3 deletions

View file

@ -1041,7 +1041,7 @@ class LogEntry2(BaseModel):
class LogEntry3(BaseModel):
id = BigAutoField()
kind = ForeignKeyField(LogEntryKind)
kind = IntegerField(db_column='kind_id')
account = IntegerField(db_column='account_id')
performer = IntegerField(null=True, db_column='performer_id')
repository = IntegerField(null=True, db_column='repository_id')

View file

@ -25,12 +25,10 @@ def upgrade(tables, tester):
sa.Column('datetime', sa.DateTime(), nullable=False),
sa.Column('ip', sa.String(length=255), nullable=True),
sa.Column('metadata_json', sa.Text(), nullable=False),
sa.ForeignKeyConstraint(['kind_id'], ['logentrykind.id'], name=op.f('fk_logentry3_kind_id_logentrykind')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_logentry3'))
)
op.create_index('logentry3_account_id_datetime', 'logentry3', ['account_id', 'datetime'], unique=False)
op.create_index('logentry3_datetime', 'logentry3', ['datetime'], unique=False)
op.create_index('logentry3_kind_id', 'logentry3', ['kind_id'], unique=False)
op.create_index('logentry3_performer_id_datetime', 'logentry3', ['performer_id', 'datetime'], unique=False)
op.create_index('logentry3_repository_id_datetime_kind_id', 'logentry3', ['repository_id', 'datetime', 'kind_id'], unique=False)
# ### end Alembic commands ###