fix: add created_at/updated_at to workspace_users (TenantMixin inherits TimestampMixin)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""Add created_at/updated_at to workspace_users and workspace_widgets.
|
||||
|
||||
TenantMixin inherits from TimestampMixin which adds created_at and updated_at.
|
||||
Migration 0072 only added assigned_at to workspace_users, not created_at/updated_at.
|
||||
|
||||
Revision ID: 0074
|
||||
Revises: 0073
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "0074"
|
||||
down_revision = "0073"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# workspace_users: add created_at and updated_at
|
||||
op.add_column("workspace_users", sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False))
|
||||
op.add_column("workspace_users", sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("NOW()"), nullable=False))
|
||||
|
||||
# workspace_widgets: already has created_at/updated_at from migration 0072
|
||||
# workspace_modules: already has created_at/updated_at from migration 0072
|
||||
# workspaces: already has created_at/updated_at from migration 0072
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("workspace_users", "updated_at")
|
||||
op.drop_column("workspace_users", "created_at")
|
||||
Reference in New Issue
Block a user