mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Merge pull request #2450 from alphagov/email-branding-unique-constraint
Update EmailBranding.name to be not null and unique.
This commit is contained in:
@@ -6,13 +6,13 @@ post_create_email_branding_schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"colour": {"type": ["string", "null"]},
|
||||
"name": {"type": ["string", "null"]},
|
||||
"name": {"type": "string"},
|
||||
"text": {"type": ["string", "null"]},
|
||||
"logo": {"type": ["string", "null"]},
|
||||
"domain": {"type": ["string", "null"]},
|
||||
"brand_type": {"enum": BRANDING_TYPES},
|
||||
},
|
||||
"required": []
|
||||
"required": ["name"]
|
||||
}
|
||||
|
||||
post_update_email_branding_schema = {
|
||||
|
||||
@@ -219,7 +219,7 @@ class EmailBranding(db.Model):
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
colour = db.Column(db.String(7), nullable=True)
|
||||
logo = db.Column(db.String(255), nullable=True)
|
||||
name = db.Column(db.String(255), nullable=True)
|
||||
name = db.Column(db.String(255), unique=True, nullable=False)
|
||||
text = db.Column(db.String(255), nullable=True)
|
||||
domain = db.Column(db.Text, unique=True, nullable=True)
|
||||
brand_type = db.Column(
|
||||
|
||||
Reference in New Issue
Block a user