mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 20:32:39 +02:00
fix(database): handle duplicate podcast_status type creation gracefully
Modify the upgrade function to prevent errors when creating the podcast_status ENUM type by wrapping the creation in a DO block that catches duplicate_object exceptions.
This commit is contained in:
parent
0b65c3a98c
commit
1f1d513437
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,11 @@ depends_on: str | Sequence[str] | None = None
|
|||
def upgrade() -> None:
|
||||
op.execute(
|
||||
"""
|
||||
CREATE TYPE podcast_status AS ENUM ('pending', 'generating', 'ready', 'failed');
|
||||
DO $$ BEGIN
|
||||
CREATE TYPE podcast_status AS ENUM ('pending', 'generating', 'ready', 'failed');
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
"""
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue