M15: synchronize contracts and acceptance
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
"""persist revoked sessions
|
||||
|
||||
Revision ID: d1f83bc64170
|
||||
Revises: b7c7b536df85
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "d1f83bc64170"
|
||||
down_revision = "b7c7b536df85"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"revoked_sessions",
|
||||
sa.Column("token_hash", sa.String(length=64), nullable=False),
|
||||
sa.Column("expires_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column(
|
||||
"created_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("now()"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column(
|
||||
"updated_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("now()"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_index("ix_revoked_sessions_expires_at", "revoked_sessions", ["expires_at"])
|
||||
op.create_index(
|
||||
"ix_revoked_sessions_token_hash",
|
||||
"revoked_sessions",
|
||||
["token_hash"],
|
||||
unique=True,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_revoked_sessions_token_hash", table_name="revoked_sessions")
|
||||
op.drop_index("ix_revoked_sessions_expires_at", table_name="revoked_sessions")
|
||||
op.drop_table("revoked_sessions")
|
||||
Reference in New Issue
Block a user