mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-17 19:41:05 +02:00
Add name to API Key (#1327)
This commit is contained in:
parent
d2d042a2cc
commit
b9b1e22fac
@ -0,0 +1,23 @@
|
|||||||
|
"""Add name to api_key
|
||||||
|
|
||||||
|
Revision ID: 475fcefe8826
|
||||||
|
Revises: ecab2b3f1a3b
|
||||||
|
Create Date: 2024-04-11 11:05:18.414438
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = "475fcefe8826"
|
||||||
|
down_revision = "ecab2b3f1a3b"
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
op.add_column("api_key", sa.Column("name", sa.String(), nullable=True))
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
op.drop_column("api_key", "name")
|
@ -87,6 +87,7 @@ class ApiKey(Base):
|
|||||||
__tablename__ = "api_key"
|
__tablename__ = "api_key"
|
||||||
|
|
||||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||||
|
name: Mapped[str | None] = mapped_column(String, nullable=True)
|
||||||
hashed_api_key: Mapped[str] = mapped_column(String, unique=True)
|
hashed_api_key: Mapped[str] = mapped_column(String, unique=True)
|
||||||
api_key_display: Mapped[str] = mapped_column(String, unique=True)
|
api_key_display: Mapped[str] = mapped_column(String, unique=True)
|
||||||
# the ID of the "user" who represents the access credentials for the API key
|
# the ID of the "user" who represents the access credentials for the API key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user