Skip to content

Commit 310ac13

Browse files
formatting
1 parent 24ca987 commit 310ac13

2 files changed

Lines changed: 10 additions & 19 deletions

File tree

src/data/rabbitmq_pending_message_data.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ class RabbitmqPendingMessageModel(BaseModel):
1313

1414
class RabbitmqPendingMessageData(BaseData):
1515
def get_rabbitmq_pending_message_by_id(self, id: int) -> Optional[RabbitmqPendingMessageModel]:
16-
sql = text(
17-
"""
16+
sql = text("""
1817
SELECT * FROM rabbitmq_pending_messages
1918
WHERE id = :id;
20-
"""
21-
)
19+
""")
2220

2321
result_rows = self.execute(sql, id=id)
2422
if not result_rows:
@@ -27,12 +25,10 @@ def get_rabbitmq_pending_message_by_id(self, id: int) -> Optional[RabbitmqPendin
2725
return RabbitmqPendingMessageModel(result_rows[0])
2826

2927
def get_rabbitmq_pending_messages(self) -> list[RabbitmqPendingMessageModel]:
30-
sql = text(
31-
"""
28+
sql = text("""
3229
SELECT * FROM rabbitmq_pending_messages
3330
ORDER BY created_time ASC;
34-
"""
35-
)
31+
""")
3632

3733
result_rows = self.execute(sql)
3834
return [RabbitmqPendingMessageModel(row) for row in result_rows]

tools/db_migration/versions/20251220T022458Z_add_rabbitmq_pending_table_a5f2ff2c36f8.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"""
88

99
from alembic import op
10-
import sqlalchemy as sa
11-
1210

1311
# revision identifiers, used by Alembic.
1412
revision = "a5f2ff2c36f8"
@@ -18,8 +16,7 @@
1816

1917

2018
def upgrade():
21-
op.execute(
22-
"""
19+
op.execute("""
2320
CREATE TABLE rabbitmq_pending_messages (
2421
id BIGSERIAL PRIMARY KEY,
2522
type TEXT NOT NULL,
@@ -28,14 +25,12 @@ def upgrade():
2825
json_body JSONB NOT NULL,
2926
created_time TIMESTAMPTZ NOT NULL DEFAULT now()
3027
);
31-
CREATE UNIQUE INDEX IF NOT EXISTS idx_rabbitmq_pending_messages_created_time ON rabbitmq_pending_messages(created_time);
32-
"""
33-
)
28+
CREATE UNIQUE INDEX IF NOT EXISTS
29+
idx_rabbitmq_pending_messages_created_time ON rabbitmq_pending_messages(created_time);
30+
""")
3431

3532

3633
def downgrade():
37-
op.execute(
38-
"""
34+
op.execute("""
3935
DROP TABLE IF EXISTS rabbitmq_pending_messages;
40-
"""
41-
)
36+
""")

0 commit comments

Comments
 (0)