From e68d19d8b364d88c13b9c7814f07ee1dc2451243 Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 19 Dec 2022 11:25:21 -0500 Subject: [PATCH] added updated and created at columns on user w/ burnettk --- spiffworkflow-backend/migrations/env.py | 2 ++ .../versions/{4d75421c0af0_.py => e284612a9778_.py} | 8 +++++--- .../src/spiffworkflow_backend/models/user.py | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) rename spiffworkflow-backend/migrations/versions/{4d75421c0af0_.py => e284612a9778_.py} (98%) diff --git a/spiffworkflow-backend/migrations/env.py b/spiffworkflow-backend/migrations/env.py index 630e381a..68feded2 100644 --- a/spiffworkflow-backend/migrations/env.py +++ b/spiffworkflow-backend/migrations/env.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + import logging from logging.config import fileConfig diff --git a/spiffworkflow-backend/migrations/versions/4d75421c0af0_.py b/spiffworkflow-backend/migrations/versions/e284612a9778_.py similarity index 98% rename from spiffworkflow-backend/migrations/versions/4d75421c0af0_.py rename to spiffworkflow-backend/migrations/versions/e284612a9778_.py index 34fa1e97..5ce586ad 100644 --- a/spiffworkflow-backend/migrations/versions/4d75421c0af0_.py +++ b/spiffworkflow-backend/migrations/versions/e284612a9778_.py @@ -1,8 +1,8 @@ """empty message -Revision ID: 4d75421c0af0 +Revision ID: e284612a9778 Revises: -Create Date: 2022-12-06 17:42:56.417673 +Create Date: 2022-12-19 11:23:10.567440 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = '4d75421c0af0' +revision = 'e284612a9778' down_revision = None branch_labels = None depends_on = None @@ -77,6 +77,8 @@ def upgrade(): sa.Column('service_id', sa.String(length=255), nullable=False), sa.Column('name', sa.String(length=255), nullable=True), sa.Column('email', sa.String(length=255), nullable=True), + sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), + sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('service', 'service_id', name='service_key'), sa.UniqueConstraint('uid') diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py index b8c83d0f..5fa09896 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py @@ -37,6 +37,8 @@ class UserModel(SpiffworkflowBaseDBModel): service_id = db.Column(db.String(255), nullable=False, unique=False) name = db.Column(db.String(255)) email = db.Column(db.String(255)) + updated_at_in_seconds: int = db.Column(db.Integer) + created_at_in_seconds: int = db.Column(db.Integer) user_group_assignments = relationship("UserGroupAssignmentModel", cascade="delete") # type: ignore groups = relationship( # type: ignore