OpenOversight icon indicating copy to clipboard operation
OpenOversight copied to clipboard

Finish audit fields for `users` table

Open michplunkett opened this issue 4 months ago • 0 comments

Fixes issue

https://github.com/lucyparsons/OpenOversight/issues/1004

Description of Changes

Added disabled_by, disabled_at, approved_at, approved_by, and confirmed_at, and confirmed_by fields to the users table so that we could keep track of users actions on the platform at a more granular level. I also removed the previously mentioned columns corresponding boolean columns.

Tests and Linting

  • [x] This branch is up-to-date with the develop branch.
  • [x] pytest passes on my local development environment.
  • [x] pre-commit passes on my local development environment.
  • [x] The flask db upgrade and flask db downgrade functions work for both migrations.
I have no name!@c38d30934aa7:/usr/src/app$ %
(env) michaelp@MacBook-Air-18 OpenOversight % docker exec -it openoversight-web-1 bash
I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade
...
INFO  [alembic.runtime.migration] Running downgrade 99c50fc8d294 -> bf254c0961ca, complete audit field addition to users
I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade
...
INFO  [alembic.runtime.migration] Running downgrade bf254c0961ca -> 5865f488470c, add remaining audit fields for users table
I have no name!@5027495d31c0:/usr/src/app$ flask db downgrade
...
INFO  [alembic.runtime.migration] Running downgrade 5865f488470c -> 939ea0f2b26d, change salary column types
I have no name!@5027495d31c0:/usr/src/app$ flask db upgrade
...
INFO  [alembic.runtime.migration] Running upgrade 939ea0f2b26d -> 5865f488470c, change salary column types
INFO  [alembic.runtime.migration] Running upgrade 5865f488470c -> bf254c0961ca, add remaining audit fields for users table
INFO  [alembic.runtime.migration] Running upgrade bf254c0961ca -> 99c50fc8d294, complete audit field addition to users
I have no name!@5027495d31c0:/usr/src/app$

michplunkett avatar Oct 09 '24 20:10 michplunkett