Fix nullable non nullable fields

This commit is contained in:
Antoine Bertin 2021-04-28 01:20:32 +02:00
commit 0cfa6900ca
No known key found for this signature in database
GPG key ID: 09851B52754E2327
4 changed files with 7 additions and 13 deletions

View file

@ -41,7 +41,9 @@ RUN apk add --update --no-cache --virtual .build-deps \
apk --purge del .build-deps
COPY ./mealie /app/mealie
RUN poetry install --no-dev
RUN poetry install --no-dev
# add database drivers
RUN pip install psycopg2-binary
COPY ./Caddyfile /app
COPY ./dev/data/templates /app/data/templates
@ -51,4 +53,3 @@ VOLUME [ "/app/data/" ]
RUN chmod +x /app/mealie/run.sh
CMD /app/mealie/run.sh

View file

@ -37,8 +37,8 @@ def upgrade():
groups_table = op.create_table('groups',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.Column('webhook_enable', sa.Boolean(), nullable=True),
sa.Column('webhook_time', sa.String(), nullable=True),
sa.Column('webhook_enable', sa.Boolean(), nullable=False),
sa.Column('webhook_time', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_groups_name'), 'groups', ['name'], unique=True)

View file

@ -26,8 +26,8 @@ class Group(SqlAlchemyBase, BaseMixins):
categories = orm.relationship("Category", secondary=group2categories, single_parent=True)
# Webhook Settings
webhook_enable = sa.Column(sa.Boolean, default=False)
webhook_time = sa.Column(sa.String, default="00:00")
webhook_enable = sa.Column(sa.Boolean, default=False, nullable=False)
webhook_time = sa.Column(sa.String, default="00:00", nullable=False)
webhook_urls = orm.relationship("WebhookURLModel", uselist=True, cascade="all, delete-orphan")
def __init__(

View file

@ -38,13 +38,6 @@ class UserBase(CamelModel):
"group": name_orm.group.name,
}
schema_extra = {
"fullName": "Change Me",
"email": "changeme@email.com",
"group": settings.DEFAULT_GROUP,
"admin": "false",
}
class UserIn(UserBase):
password: str