Re-create migrations init tables
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIB9jCCAZ2gAwIBAgIRAPUOX65UsT3WtlNpuE6x5jgwCgYIKoZIzj0EAwIwWzEL
|
MIIB9zCCAZ2gAwIBAgIRAJVj3HmLerDV1SxKRT/hLAQwCgYIKoZIzj0EAwIwWzEL
|
||||||
MAkGA1UEBhMCVVMxEjAQBgNVBAoTCUJha2VyeSBJQTEbMBkGA1UECxMSQmFrZXJ5
|
MAkGA1UEBhMCVVMxEjAQBgNVBAoTCUJha2VyeSBJQTEbMBkGA1UECxMSQmFrZXJ5
|
||||||
IElBIExvY2FsIENBMRswGQYDVQQDExJiYWtlcnktaWEtbG9jYWwtY2EwHhcNMjUx
|
IElBIExvY2FsIENBMRswGQYDVQQDExJiYWtlcnktaWEtbG9jYWwtY2EwHhcNMjUx
|
||||||
MDA2MTMwNjE4WhcNMjYxMDA2MTMwNjE4WjBbMQswCQYDVQQGEwJVUzESMBAGA1UE
|
MDA5MTgyOTA0WhcNMjYxMDA5MTgyOTA0WjBbMQswCQYDVQQGEwJVUzESMBAGA1UE
|
||||||
ChMJQmFrZXJ5IElBMRswGQYDVQQLExJCYWtlcnkgSUEgTG9jYWwgQ0ExGzAZBgNV
|
ChMJQmFrZXJ5IElBMRswGQYDVQQLExJCYWtlcnkgSUEgTG9jYWwgQ0ExGzAZBgNV
|
||||||
BAMTEmJha2VyeS1pYS1sb2NhbC1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
|
BAMTEmJha2VyeS1pYS1sb2NhbC1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA
|
||||||
BI2I3hRyqDN3xzMrAHtOepHeYXh/G+90bjjGZWr8hHJPJ8TUHvqFNFYfeNBOu1qH
|
BMftW8JmthKeoYWGsVj42CuJFjidmwCCTcdtj6CcL0nnlFS0Dlv9djFLfxyqnpZP
|
||||||
i5zBJQeMoH/U8Q0EzGhItxKjQjBAMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8E
|
QHmjp7b8yhgWKVL8wq/zJUajQjBAMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8E
|
||||||
BTADAQH/MB0GA1UdDgQWBBQp26NR1NacXBN3i+NwGFW0gTyoRjAKBggqhkjOPQQD
|
BTADAQH/MB0GA1UdDgQWBBRRtIEm0BSsSti/oLUDtbM4spslUjAKBggqhkjOPQQD
|
||||||
AgNHADBEAiBvFmHHzokSC7k/Wkp50XH/dI8QPaciOX38GR+sYX9T2QIgZwAe7yXc
|
AgNIADBFAiBBoTfxXh5VqlPZVi60uoB76AZ56HJ96BgB7x353ECw8QIhAORe2MAd
|
||||||
5VK7ePqMvaHZT4rK6wx8yDgXK0qEbYNmCsI=
|
n/q+dE6TN4VUkze8/Psur8ZbMDXmvRpXzY44
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ done
|
|||||||
SERVICES=(
|
SERVICES=(
|
||||||
"pos" "sales" "recipes" "training" "auth" "orders" "inventory"
|
"pos" "sales" "recipes" "training" "auth" "orders" "inventory"
|
||||||
"suppliers" "tenant" "notification" "alert-processor" "forecasting"
|
"suppliers" "tenant" "notification" "alert-processor" "forecasting"
|
||||||
"external" "production"
|
"external" "production" "demo-session"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Backup directory
|
# Backup directory
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: 974e93c92b37
|
Revision ID: 48724b300473
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:57.092764+02:00
|
Create Date: 2025-10-09 20:39:33.768021+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '974e93c92b37'
|
revision: str = '48724b300473'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: 088732328278
|
Revision ID: 105797cd9710
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:10.007779+02:00
|
Create Date: 2025-10-09 20:38:43.315537+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '088732328278'
|
revision: str = '105797cd9710'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
"""Add city data tables
|
|
||||||
|
|
||||||
Revision ID: 20251007_0733
|
|
||||||
Revises: 44983b9ad55b
|
|
||||||
Create Date: 2025-10-07 07:33:00.000000
|
|
||||||
|
|
||||||
"""
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
from sqlalchemy.dialects import postgresql
|
|
||||||
|
|
||||||
revision = '20251007_0733'
|
|
||||||
down_revision = '44983b9ad55b'
|
|
||||||
branch_labels = None
|
|
||||||
depends_on = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
|
||||||
op.create_table(
|
|
||||||
'city_weather_data',
|
|
||||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
|
||||||
sa.Column('city_id', sa.String(length=50), nullable=False),
|
|
||||||
sa.Column('date', sa.DateTime(timezone=True), nullable=False),
|
|
||||||
sa.Column('temperature', sa.Float(), nullable=True),
|
|
||||||
sa.Column('precipitation', sa.Float(), nullable=True),
|
|
||||||
sa.Column('humidity', sa.Float(), nullable=True),
|
|
||||||
sa.Column('wind_speed', sa.Float(), nullable=True),
|
|
||||||
sa.Column('pressure', sa.Float(), nullable=True),
|
|
||||||
sa.Column('description', sa.String(length=200), nullable=True),
|
|
||||||
sa.Column('source', sa.String(length=50), nullable=False),
|
|
||||||
sa.Column('raw_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
|
||||||
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True),
|
|
||||||
sa.PrimaryKeyConstraint('id')
|
|
||||||
)
|
|
||||||
op.create_index('idx_city_weather_lookup', 'city_weather_data', ['city_id', 'date'], unique=False)
|
|
||||||
op.create_index(op.f('ix_city_weather_data_city_id'), 'city_weather_data', ['city_id'], unique=False)
|
|
||||||
op.create_index(op.f('ix_city_weather_data_date'), 'city_weather_data', ['date'], unique=False)
|
|
||||||
|
|
||||||
op.create_table(
|
|
||||||
'city_traffic_data',
|
|
||||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
|
||||||
sa.Column('city_id', sa.String(length=50), nullable=False),
|
|
||||||
sa.Column('date', sa.DateTime(timezone=True), nullable=False),
|
|
||||||
sa.Column('traffic_volume', sa.Integer(), nullable=True),
|
|
||||||
sa.Column('pedestrian_count', sa.Integer(), nullable=True),
|
|
||||||
sa.Column('congestion_level', sa.String(length=20), nullable=True),
|
|
||||||
sa.Column('average_speed', sa.Float(), nullable=True),
|
|
||||||
sa.Column('source', sa.String(length=50), nullable=False),
|
|
||||||
sa.Column('raw_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
|
||||||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
|
||||||
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True),
|
|
||||||
sa.PrimaryKeyConstraint('id')
|
|
||||||
)
|
|
||||||
op.create_index('idx_city_traffic_lookup', 'city_traffic_data', ['city_id', 'date'], unique=False)
|
|
||||||
op.create_index(op.f('ix_city_traffic_data_city_id'), 'city_traffic_data', ['city_id'], unique=False)
|
|
||||||
op.create_index(op.f('ix_city_traffic_data_date'), 'city_traffic_data', ['date'], unique=False)
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade():
|
|
||||||
op.drop_index(op.f('ix_city_traffic_data_date'), table_name='city_traffic_data')
|
|
||||||
op.drop_index(op.f('ix_city_traffic_data_city_id'), table_name='city_traffic_data')
|
|
||||||
op.drop_index('idx_city_traffic_lookup', table_name='city_traffic_data')
|
|
||||||
op.drop_table('city_traffic_data')
|
|
||||||
|
|
||||||
op.drop_index(op.f('ix_city_weather_data_date'), table_name='city_weather_data')
|
|
||||||
op.drop_index(op.f('ix_city_weather_data_city_id'), table_name='city_weather_data')
|
|
||||||
op.drop_index('idx_city_weather_lookup', table_name='city_weather_data')
|
|
||||||
op.drop_table('city_weather_data')
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1517
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: 44983b9ad55b
|
Revision ID: e1c05c379c10
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:17:13.717978+02:00
|
Create Date: 2025-10-09 20:39:49.989716+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '44983b9ad55b'
|
revision: str = 'e1c05c379c10'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -20,6 +20,42 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('city_traffic_data',
|
||||||
|
sa.Column('id', sa.UUID(), nullable=False),
|
||||||
|
sa.Column('city_id', sa.String(length=50), nullable=False),
|
||||||
|
sa.Column('date', sa.DateTime(timezone=True), nullable=False),
|
||||||
|
sa.Column('traffic_volume', sa.Integer(), nullable=True),
|
||||||
|
sa.Column('pedestrian_count', sa.Integer(), nullable=True),
|
||||||
|
sa.Column('congestion_level', sa.String(length=20), nullable=True),
|
||||||
|
sa.Column('average_speed', sa.Float(), nullable=True),
|
||||||
|
sa.Column('source', sa.String(length=50), nullable=False),
|
||||||
|
sa.Column('raw_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||||
|
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
||||||
|
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True),
|
||||||
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
)
|
||||||
|
op.create_index('idx_city_traffic_lookup', 'city_traffic_data', ['city_id', 'date'], unique=False)
|
||||||
|
op.create_index(op.f('ix_city_traffic_data_city_id'), 'city_traffic_data', ['city_id'], unique=False)
|
||||||
|
op.create_index(op.f('ix_city_traffic_data_date'), 'city_traffic_data', ['date'], unique=False)
|
||||||
|
op.create_table('city_weather_data',
|
||||||
|
sa.Column('id', sa.UUID(), nullable=False),
|
||||||
|
sa.Column('city_id', sa.String(length=50), nullable=False),
|
||||||
|
sa.Column('date', sa.DateTime(timezone=True), nullable=False),
|
||||||
|
sa.Column('temperature', sa.Float(), nullable=True),
|
||||||
|
sa.Column('precipitation', sa.Float(), nullable=True),
|
||||||
|
sa.Column('humidity', sa.Float(), nullable=True),
|
||||||
|
sa.Column('wind_speed', sa.Float(), nullable=True),
|
||||||
|
sa.Column('pressure', sa.Float(), nullable=True),
|
||||||
|
sa.Column('description', sa.String(length=200), nullable=True),
|
||||||
|
sa.Column('source', sa.String(length=50), nullable=False),
|
||||||
|
sa.Column('raw_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||||
|
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
||||||
|
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True),
|
||||||
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
)
|
||||||
|
op.create_index('idx_city_weather_lookup', 'city_weather_data', ['city_id', 'date'], unique=False)
|
||||||
|
op.create_index(op.f('ix_city_weather_data_city_id'), 'city_weather_data', ['city_id'], unique=False)
|
||||||
|
op.create_index(op.f('ix_city_weather_data_date'), 'city_weather_data', ['date'], unique=False)
|
||||||
op.create_table('traffic_background_jobs',
|
op.create_table('traffic_background_jobs',
|
||||||
sa.Column('id', sa.UUID(), nullable=False),
|
sa.Column('id', sa.UUID(), nullable=False),
|
||||||
sa.Column('job_type', sa.String(length=50), nullable=False),
|
sa.Column('job_type', sa.String(length=50), nullable=False),
|
||||||
@@ -221,4 +257,12 @@ def downgrade() -> None:
|
|||||||
op.drop_index('idx_jobs_completed', table_name='traffic_background_jobs')
|
op.drop_index('idx_jobs_completed', table_name='traffic_background_jobs')
|
||||||
op.drop_index('idx_jobs_city_status', table_name='traffic_background_jobs')
|
op.drop_index('idx_jobs_city_status', table_name='traffic_background_jobs')
|
||||||
op.drop_table('traffic_background_jobs')
|
op.drop_table('traffic_background_jobs')
|
||||||
|
op.drop_index(op.f('ix_city_weather_data_date'), table_name='city_weather_data')
|
||||||
|
op.drop_index(op.f('ix_city_weather_data_city_id'), table_name='city_weather_data')
|
||||||
|
op.drop_index('idx_city_weather_lookup', table_name='city_weather_data')
|
||||||
|
op.drop_table('city_weather_data')
|
||||||
|
op.drop_index(op.f('ix_city_traffic_data_date'), table_name='city_traffic_data')
|
||||||
|
op.drop_index(op.f('ix_city_traffic_data_city_id'), table_name='city_traffic_data')
|
||||||
|
op.drop_index('idx_city_traffic_lookup', table_name='city_traffic_data')
|
||||||
|
op.drop_table('city_traffic_data')
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1517
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: 706c5b559062
|
Revision ID: cae963fbc2af
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:17:05.820037+02:00
|
Create Date: 2025-10-09 20:39:42.106460+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '706c5b559062'
|
revision: str = 'cae963fbc2af'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -24,7 +24,7 @@ def upgrade() -> None:
|
|||||||
sa.Column('id', sa.UUID(), nullable=False),
|
sa.Column('id', sa.UUID(), nullable=False),
|
||||||
sa.Column('tenant_id', sa.UUID(), nullable=False),
|
sa.Column('tenant_id', sa.UUID(), nullable=False),
|
||||||
sa.Column('inventory_product_id', sa.UUID(), nullable=False),
|
sa.Column('inventory_product_id', sa.UUID(), nullable=False),
|
||||||
sa.Column('product_name', sa.String(length=255), nullable=False),
|
sa.Column('product_name', sa.String(length=255), nullable=True),
|
||||||
sa.Column('location', sa.String(length=255), nullable=False),
|
sa.Column('location', sa.String(length=255), nullable=False),
|
||||||
sa.Column('forecast_date', sa.DateTime(timezone=True), nullable=False),
|
sa.Column('forecast_date', sa.DateTime(timezone=True), nullable=False),
|
||||||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
"""make product_name nullable
|
|
||||||
|
|
||||||
Revision ID: a1b2c3d4e5f6
|
|
||||||
Revises: 706c5b559062
|
|
||||||
Create Date: 2025-10-09 04:55:00.000000
|
|
||||||
|
|
||||||
"""
|
|
||||||
from typing import Sequence, Union
|
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
|
||||||
revision: str = 'a1b2c3d4e5f6'
|
|
||||||
down_revision: Union[str, None] = '706c5b559062'
|
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
|
||||||
# Make product_name nullable since we use inventory_product_id as the primary reference
|
|
||||||
op.alter_column('forecasts', 'product_name',
|
|
||||||
existing_type=sa.VARCHAR(length=255),
|
|
||||||
nullable=True)
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
|
||||||
# Revert to not null (requires data to be populated first)
|
|
||||||
op.alter_column('forecasts', 'product_name',
|
|
||||||
existing_type=sa.VARCHAR(length=255),
|
|
||||||
nullable=False)
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: 8364b91a7c64
|
Revision ID: da978256de4a
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:25.991736+02:00
|
Create Date: 2025-10-09 20:39:00.639427+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '8364b91a7c64'
|
revision: str = 'da978256de4a'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: a7f00132bed8
|
Revision ID: c27e2b79f787
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:49.792848+02:00
|
Create Date: 2025-10-09 20:39:25.955986+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = 'a7f00132bed8'
|
revision: str = 'c27e2b79f787'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: 1927463e0d6e
|
Revision ID: 2f48673b672c
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:17.959902+02:00
|
Create Date: 2025-10-09 20:38:51.897501+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '1927463e0d6e'
|
revision: str = '2f48673b672c'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1515
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: 31fcdb636d6e
|
Revision ID: 65eda9df893b
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:15:44.162404+02:00
|
Create Date: 2025-10-09 20:38:17.435929+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '31fcdb636d6e'
|
revision: str = '65eda9df893b'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1517
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: bf59b03597f6
|
Revision ID: ff7cc8350951
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:17:21.426589+02:00
|
Create Date: 2025-10-09 20:39:57.570220+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = 'bf59b03597f6'
|
revision: str = 'ff7cc8350951'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1515
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: 9360ab46c752
|
Revision ID: a89b48099599
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:15:59.127296+02:00
|
Create Date: 2025-10-09 20:38:32.626427+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '9360ab46c752'
|
revision: str = 'a89b48099599'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1515
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: be2ef5e70df5
|
Revision ID: ccb1465b527e
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:15:51.718465+02:00
|
Create Date: 2025-10-09 20:38:25.308184+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = 'be2ef5e70df5'
|
revision: str = 'ccb1465b527e'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: 70230ebce37a
|
Revision ID: 52c9e6461ed9
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:34.648714+02:00
|
Create Date: 2025-10-09 20:39:09.709448+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
from sqlalchemy.dialects import postgresql
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '70230ebce37a'
|
revision: str = '52c9e6461ed9'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -424,7 +424,7 @@ def upgrade() -> None:
|
|||||||
)
|
)
|
||||||
op.create_index(op.f('ix_supplier_alerts_alert_type'), 'supplier_alerts', ['alert_type'], unique=False)
|
op.create_index(op.f('ix_supplier_alerts_alert_type'), 'supplier_alerts', ['alert_type'], unique=False)
|
||||||
op.create_index(op.f('ix_supplier_alerts_delivery_id'), 'supplier_alerts', ['delivery_id'], unique=False)
|
op.create_index(op.f('ix_supplier_alerts_delivery_id'), 'supplier_alerts', ['delivery_id'], unique=False)
|
||||||
op.create_index('ix_supplier_alerts_metric_type', 'supplier_alerts', ['metric_type'], unique=False)
|
op.create_index(op.f('ix_supplier_alerts_metric_type'), 'supplier_alerts', ['metric_type'], unique=False)
|
||||||
op.create_index('ix_supplier_alerts_priority', 'supplier_alerts', ['priority_score'], unique=False)
|
op.create_index('ix_supplier_alerts_priority', 'supplier_alerts', ['priority_score'], unique=False)
|
||||||
op.create_index(op.f('ix_supplier_alerts_purchase_order_id'), 'supplier_alerts', ['purchase_order_id'], unique=False)
|
op.create_index(op.f('ix_supplier_alerts_purchase_order_id'), 'supplier_alerts', ['purchase_order_id'], unique=False)
|
||||||
op.create_index(op.f('ix_supplier_alerts_severity'), 'supplier_alerts', ['severity'], unique=False)
|
op.create_index(op.f('ix_supplier_alerts_severity'), 'supplier_alerts', ['severity'], unique=False)
|
||||||
@@ -578,7 +578,7 @@ def downgrade() -> None:
|
|||||||
op.drop_index(op.f('ix_supplier_alerts_severity'), table_name='supplier_alerts')
|
op.drop_index(op.f('ix_supplier_alerts_severity'), table_name='supplier_alerts')
|
||||||
op.drop_index(op.f('ix_supplier_alerts_purchase_order_id'), table_name='supplier_alerts')
|
op.drop_index(op.f('ix_supplier_alerts_purchase_order_id'), table_name='supplier_alerts')
|
||||||
op.drop_index('ix_supplier_alerts_priority', table_name='supplier_alerts')
|
op.drop_index('ix_supplier_alerts_priority', table_name='supplier_alerts')
|
||||||
op.drop_index('ix_supplier_alerts_metric_type', table_name='supplier_alerts')
|
op.drop_index(op.f('ix_supplier_alerts_metric_type'), table_name='supplier_alerts')
|
||||||
op.drop_index(op.f('ix_supplier_alerts_delivery_id'), table_name='supplier_alerts')
|
op.drop_index(op.f('ix_supplier_alerts_delivery_id'), table_name='supplier_alerts')
|
||||||
op.drop_index(op.f('ix_supplier_alerts_alert_type'), table_name='supplier_alerts')
|
op.drop_index(op.f('ix_supplier_alerts_alert_type'), table_name='supplier_alerts')
|
||||||
op.drop_table('supplier_alerts')
|
op.drop_table('supplier_alerts')
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2039
|
||||||
|
|
||||||
Revision ID: 964ef5a3ac09
|
Revision ID: 44b6798d898c
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:42.493219+02:00
|
Create Date: 2025-10-09 20:39:18.137489+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '964ef5a3ac09'
|
revision: str = '44b6798d898c'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
@@ -31,6 +31,7 @@ def upgrade() -> None:
|
|||||||
sa.Column('postal_code', sa.String(length=10), nullable=False),
|
sa.Column('postal_code', sa.String(length=10), nullable=False),
|
||||||
sa.Column('latitude', sa.Float(), nullable=True),
|
sa.Column('latitude', sa.Float(), nullable=True),
|
||||||
sa.Column('longitude', sa.Float(), nullable=True),
|
sa.Column('longitude', sa.Float(), nullable=True),
|
||||||
|
sa.Column('timezone', sa.String(length=50), nullable=False),
|
||||||
sa.Column('phone', sa.String(length=20), nullable=True),
|
sa.Column('phone', sa.String(length=20), nullable=True),
|
||||||
sa.Column('email', sa.String(length=255), nullable=True),
|
sa.Column('email', sa.String(length=255), nullable=True),
|
||||||
sa.Column('is_active', sa.Boolean(), nullable=True),
|
sa.Column('is_active', sa.Boolean(), nullable=True),
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
"""Add timezone column to tenants
|
|
||||||
|
|
||||||
Revision ID: 20251009_timezone
|
|
||||||
Revises: 964ef5a3ac09
|
|
||||||
Create Date: 2025-10-09
|
|
||||||
|
|
||||||
"""
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
|
||||||
revision = '20251009_timezone'
|
|
||||||
down_revision = '964ef5a3ac09'
|
|
||||||
branch_labels = None
|
|
||||||
depends_on = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
|
||||||
"""Add timezone column to tenants table for accurate scheduling"""
|
|
||||||
# Add timezone column with default Europe/Madrid
|
|
||||||
op.add_column('tenants', sa.Column('timezone', sa.String(50), nullable=False, server_default='Europe/Madrid'))
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
|
||||||
"""Remove timezone column from tenants table"""
|
|
||||||
op.drop_column('tenants', 'timezone')
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
"""initial_schema_20251006_1516
|
"""initial_schema_20251009_2038
|
||||||
|
|
||||||
Revision ID: b6beee8bf0bf
|
Revision ID: d9e4d3a773c4
|
||||||
Revises:
|
Revises:
|
||||||
Create Date: 2025-10-06 15:16:02.277823+02:00
|
Create Date: 2025-10-09 20:38:35.801771+02:00
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
@@ -12,7 +12,7 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = 'b6beee8bf0bf'
|
revision: str = 'd9e4d3a773c4'
|
||||||
down_revision: Union[str, None] = None
|
down_revision: Union[str, None] = None
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
Reference in New Issue
Block a user