This commit is contained in:
Gilles Soulier
2026-01-14 21:54:55 +01:00
parent c91c0f1fc9
commit d0b73b9319
140 changed files with 5822 additions and 161 deletions

View File

0
pricewatch/app/db/migrations/env.py Executable file → Normal file
View File

0
pricewatch/app/db/migrations/script.py.mako Executable file → Normal file
View File

View File

View File

@@ -0,0 +1,35 @@
"""Add webhooks table
Revision ID: 20260114_02
Revises: 20260114_01
Create Date: 2026-01-14 00:00:00
"""
from alembic import op
import sqlalchemy as sa
# Revision identifiers, used by Alembic.
revision = "20260114_02"
down_revision = "20260114_01"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.create_table(
"webhooks",
sa.Column("id", sa.Integer(), primary_key=True, autoincrement=True),
sa.Column("event", sa.String(length=50), nullable=False),
sa.Column("url", sa.Text(), nullable=False),
sa.Column("enabled", sa.Boolean(), nullable=False, server_default=sa.text("true")),
sa.Column("secret", sa.String(length=200), nullable=True),
sa.Column("created_at", sa.TIMESTAMP(), nullable=False),
)
op.create_index("ix_webhook_event", "webhooks", ["event"], unique=False)
op.create_index("ix_webhook_enabled", "webhooks", ["enabled"], unique=False)
def downgrade() -> None:
op.drop_index("ix_webhook_enabled", table_name="webhooks")
op.drop_index("ix_webhook_event", table_name="webhooks")
op.drop_table("webhooks")

View File

@@ -0,0 +1,26 @@
"""Ajout description et msrp sur products.
Revision ID: 20260115_02_product_details
Revises: 20260114_02
Create Date: 2026-01-15 10:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "20260115_02_product_details"
down_revision = "20260114_02"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column("products", sa.Column("description", sa.Text(), nullable=True))
op.add_column("products", sa.Column("msrp", sa.Numeric(10, 2), nullable=True))
def downgrade() -> None:
op.drop_column("products", "msrp")
op.drop_column("products", "description")