add table
This commit is contained in:
parent
6c383e5dd7
commit
35f551949e
1 changed files with 51 additions and 0 deletions
51
alembic/versions/394542f24f6c_add_projection_table.py
Normal file
51
alembic/versions/394542f24f6c_add_projection_table.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""add projection table
|
||||
|
||||
Revision ID: 394542f24f6c
|
||||
Revises: abfbb3d96037
|
||||
Create Date: 2025-06-14 23:57:39.301255
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "394542f24f6c"
|
||||
down_revision: Union[str, None] = "abfbb3d96037"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
op.create_table(
|
||||
"users",
|
||||
sa.Column(
|
||||
"id",
|
||||
sa.UUID(as_uuid=True),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("last_event_id", sa.UUID(as_uuid=True), nullable=False, unique=True),
|
||||
sa.Column(
|
||||
"last_event_sequence",
|
||||
sa.Integer(),
|
||||
nullable=False,
|
||||
autoincrement=True,
|
||||
unique=True,
|
||||
),
|
||||
sa.Column("name", sa.String(), nullable=False),
|
||||
sa.Column("age", sa.Integer(), nullable=False),
|
||||
sa.Column("hair_color", sa.String(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
op.drop_table("users")
|
||||
Loading…
Add table
Add a link
Reference in a new issue