mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
migration is different to head
This commit is contained in:
parent
39627a412c
commit
b44cf8be18
1 changed files with 46 additions and 0 deletions
46
alembic/versions/253a1047c623_auto_generate_id.py
Normal file
46
alembic/versions/253a1047c623_auto_generate_id.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"""auto generate id
|
||||
|
||||
Revision ID: 253a1047c623
|
||||
Revises: e8507a27795a
|
||||
Create Date: 2025-08-14 17:25:54.010315
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '253a1047c623'
|
||||
down_revision: Union[str, None] = 'e8507a27795a'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('uploaded_files', 'id',
|
||||
existing_type=sa.UUID(),
|
||||
server_default=sa.text('gen_random_uuid()'),
|
||||
existing_nullable=False)
|
||||
op.alter_column('uploaded_files', 's3_file_upload_timestamp',
|
||||
existing_type=postgresql.TIMESTAMP(timezone=True),
|
||||
server_default=sa.text("NOW() AT TIME ZONE 'utc'"),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('uploaded_files', 's3_file_upload_timestamp',
|
||||
existing_type=postgresql.TIMESTAMP(timezone=True),
|
||||
server_default=None,
|
||||
existing_nullable=False)
|
||||
op.alter_column('uploaded_files', 'id',
|
||||
existing_type=sa.UUID(),
|
||||
server_default=None,
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Reference in a new issue