Merge pull request #113 from grillazz/sqlalchemy-2

remove directive with no parameters
This commit is contained in:
Jakub Miazek 2023-09-17 15:20:01 +02:00 committed by GitHub
commit 88de0347eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 10 deletions

View File

@ -10,7 +10,7 @@ FROM base AS install
WORKDIR /home/code
# allow controlling the poetry installation of dependencies via external args
ARG INSTALL_ARGS="--no-root --only main"
ARG INSTALL_ARGS="--no-root"
ENV POETRY_HOME="/opt/poetry"
ENV PATH="$POETRY_HOME/bin:$PATH"
COPY pyproject.toml poetry.lock ./

View File

@ -13,8 +13,10 @@ class Nonsense(Base):
__tablename__ = "nonsense"
__table_args__ = ({"schema": "happy_hog"},)
id: Mapped[uuid:UUID] = mapped_column(UUID(as_uuid=True), unique=True, default=uuid.uuid4, autoincrement=True)
name: Mapped[str] = mapped_column(String, nullable=False, primary_key=True, unique=True)
description: Mapped[str] = mapped_column(String, nullable=False)
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
description: Mapped[str | None]
# TODO: apply relation to other tables
@classmethod
async def find(cls, db_session: AsyncSession, name: str):

View File

@ -11,7 +11,7 @@ from sqlalchemy import (
select,
)
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import relationship, mapped_column, Mapped
from sqlalchemy.orm import relationship
from app.models.base import Base

View File

@ -13,8 +13,8 @@ class Stuff(Base):
__tablename__ = "stuff"
__table_args__ = ({"schema": "happy_hog"},)
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), unique=True, default=uuid.uuid4, autoincrement=True)
name: Mapped[str] = mapped_column(String, nullable=False, primary_key=True, unique=True)
description: Mapped[str] = mapped_column(String, nullable=False)
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
description: Mapped[str | None]
@classmethod
async def find(cls, db_session: AsyncSession, name: str):

View File

@ -3,7 +3,7 @@ from typing import Any
import bcrypt
from passlib.context import CryptContext
from sqlalchemy import Column, String, LargeBinary, select
from sqlalchemy import String, LargeBinary, select
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import mapped_column, Mapped

View File

@ -15,9 +15,7 @@ services:
--reload --log-level debug
"
volumes:
- ./app:/home/code/app
- ./tests:/home/code/tests
- ./alembic:/home/code/alembic
- .:/home/code
ports:
- "8080:8080"
depends_on: