feat: initial commit

This commit is contained in:
2026-03-05 22:12:38 +01:00
commit bce762a783
380 changed files with 51955 additions and 0 deletions
@@ -0,0 +1,39 @@
"""Seed 'Default' (unrotated) render position for all existing products.
Revision ID: 030
Revises: 029
Create Date: 2026-03-04
"""
from alembic import op
revision = "030"
down_revision = "029"
branch_labels = None
depends_on = None
def upgrade():
# Add 'Default' (0°/0°/0°) to every product that doesn't already have it.
op.execute("""
INSERT INTO product_render_positions
(id, product_id, name, rotation_x, rotation_y, rotation_z,
is_default, sort_order, created_at, updated_at)
SELECT gen_random_uuid(), p.id,
'Default', 0.0, 0.0, 0.0, false, 2, NOW(), NOW()
FROM products p
WHERE NOT EXISTS (
SELECT 1 FROM product_render_positions rp
WHERE rp.product_id = p.id
AND lower(rp.name) = 'default'
)
""")
def downgrade():
op.execute("""
DELETE FROM product_render_positions
WHERE lower(name) = 'default'
AND rotation_x = 0.0
AND rotation_y = 0.0
AND rotation_z = 0.0
""")