mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Merge pull request #1078 from famedly/shine/config_table_key_uniqueness
fix: making the key name in the config database unique
This commit is contained in:
commit
0418edddd9
@ -0,0 +1,24 @@
|
||||
"""Add unique index to settings table keys
|
||||
|
||||
Revision ID: b24bf17725d2
|
||||
Revises: 0967658d9c0d
|
||||
Create Date: 2021-12-12 20:29:17.103441
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b24bf17725d2'
|
||||
down_revision = '0967658d9c0d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_index(op.f('ix_setting_name'), 'setting', ['name'], unique=True)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index(op.f('ix_setting_name'), table_name='setting')
|
@ -11,7 +11,7 @@ from .base import db
|
||||
|
||||
class Setting(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(64))
|
||||
name = db.Column(db.String(64), unique=True, index=True)
|
||||
value = db.Column(db.Text())
|
||||
|
||||
defaults = {
|
||||
|
Loading…
Reference in New Issue
Block a user