mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-30 04:31:49 +02:00
Foreign key input prompts
Foreign key input prompts
This commit is contained in:
commit
5edba4a7f3
@ -0,0 +1,77 @@
|
|||||||
|
"""foreign key input prompts
|
||||||
|
|
||||||
|
Revision ID: 33ea50e88f24
|
||||||
|
Revises: a6df6b88ef81
|
||||||
|
Create Date: 2025-01-29 10:54:22.141765
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = "33ea50e88f24"
|
||||||
|
down_revision = "a6df6b88ef81"
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
# First drop the existing FK constraints
|
||||||
|
op.drop_constraint(
|
||||||
|
"inputprompt__user_input_prompt_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
type_="foreignkey",
|
||||||
|
)
|
||||||
|
op.drop_constraint(
|
||||||
|
"inputprompt__user_user_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
type_="foreignkey",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Recreate with ON DELETE CASCADE
|
||||||
|
op.create_foreign_key(
|
||||||
|
"inputprompt__user_input_prompt_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
"inputprompt",
|
||||||
|
["input_prompt_id"],
|
||||||
|
["id"],
|
||||||
|
ondelete="CASCADE",
|
||||||
|
)
|
||||||
|
op.create_foreign_key(
|
||||||
|
"inputprompt__user_user_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
'"user"',
|
||||||
|
["user_id"],
|
||||||
|
["id"],
|
||||||
|
ondelete="CASCADE",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
# Drop the new FKs with ondelete
|
||||||
|
op.drop_constraint(
|
||||||
|
"inputprompt__user_input_prompt_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
type_="foreignkey",
|
||||||
|
)
|
||||||
|
op.drop_constraint(
|
||||||
|
"inputprompt__user_user_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
type_="foreignkey",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Recreate them without cascading
|
||||||
|
op.create_foreign_key(
|
||||||
|
"inputprompt__user_input_prompt_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
"inputprompt",
|
||||||
|
["input_prompt_id"],
|
||||||
|
["id"],
|
||||||
|
)
|
||||||
|
op.create_foreign_key(
|
||||||
|
"inputprompt__user_user_id_fkey",
|
||||||
|
"inputprompt__user",
|
||||||
|
'"user"',
|
||||||
|
["user_id"],
|
||||||
|
["id"],
|
||||||
|
)
|
@ -275,7 +275,6 @@ export const HistorySidebar = forwardRef<HTMLDivElement, HistorySidebarProps>(
|
|||||||
flex-col relative
|
flex-col relative
|
||||||
h-screen
|
h-screen
|
||||||
pt-2
|
pt-2
|
||||||
|
|
||||||
transition-transform
|
transition-transform
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user