Merge branch 'master' into get_by_attributes
This commit is contained in:
21
lemur/migrations/versions/6006c79b6011_.py
Normal file
21
lemur/migrations/versions/6006c79b6011_.py
Normal file
@ -0,0 +1,21 @@
|
||||
"""Add unique constraint to label column on sources table
|
||||
|
||||
Revision ID: 6006c79b6011
|
||||
Revises: 984178255c83
|
||||
Create Date: 2018-10-19 15:23:06.750510
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6006c79b6011'
|
||||
down_revision = '984178255c83'
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_unique_constraint("uq_label", 'sources', ['label'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint("uq_label", 'sources', type_='unique')
|
@ -17,7 +17,7 @@ from sqlalchemy_utils import ArrowType
|
||||
class Source(db.Model):
|
||||
__tablename__ = 'sources'
|
||||
id = Column(Integer, primary_key=True)
|
||||
label = Column(String(32))
|
||||
label = Column(String(32), unique=True)
|
||||
options = Column(JSONType)
|
||||
description = Column(Text())
|
||||
plugin_name = Column(String(32))
|
||||
|
Reference in New Issue
Block a user