31 lines
887 B
Python
31 lines
887 B
Python
"""create table for contact_forms
|
|
|
|
Revision ID: 2b9e7c8a3f0e
|
|
Revises: 0001
|
|
Create Date: 2023-05-24 12:34:56
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.sql import func
|
|
import uuid
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '2b9e7c8a3f0e'
|
|
down_revision = '0001'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
def upgrade():
|
|
op.create_table(
|
|
'contact_forms',
|
|
sa.Column('id', sa.String(36), primary_key=True, default=lambda: str(uuid.uuid4())),
|
|
sa.Column('name', sa.String(), nullable=False),
|
|
sa.Column('email', sa.String(), nullable=False),
|
|
sa.Column('message', sa.Text(), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(), server_default=func.now()),
|
|
sa.Column('updated_at', sa.DateTime(), server_default=func.now(), onupdate=func.now())
|
|
)
|
|
|
|
def downgrade():
|
|
op.drop_table('contact_forms') |