Skip to content

Commit

Permalink
Add IF NOT EXISTS for entry table creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Mar 28, 2022
1 parent 7b609eb commit b7e4a2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rss/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def upgrade_latest(conn: Connection, scheme: Scheme) -> None:
)"""
)
await conn.execute(
"""CREATE TABLE entry (
"""CREATE TABLE IF NOT EXISTS entry (
feed_id INTEGER,
id TEXT,
date timestamp NOT NULL,
Expand All @@ -59,7 +59,7 @@ async def upgrade_latest(conn: Connection, scheme: Scheme) -> None:
link TEXT NOT NULL,
PRIMARY KEY (feed_id, id),
FOREIGN KEY (feed_id) REFERENCES feed (id)
);"""
)"""
)


Expand Down

0 comments on commit b7e4a2a

Please sign in to comment.