-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(api) add database tables auditability
We need to be able to track who changed what when on most of our data for auditability purpose. For performance purpose, we decided to use PostgreSQL table triggers to track table changes over time.
- Loading branch information
Showing
22 changed files
with
699 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from polyfactory.pytest_plugin import register_fixture | ||
|
||
from qualicharge.conf import settings | ||
from qualicharge.factories import FrenchDataclassFactory, TimestampedSQLModelFactory | ||
from qualicharge.factories import AuditableSQLModelFactory, FrenchDataclassFactory | ||
|
||
from .models import IDToken | ||
from .schemas import Group, ScopesEnum, User | ||
|
@@ -33,7 +33,7 @@ class IDTokenFactory(ModelFactory[IDToken]): | |
email = "[email protected]" | ||
|
||
|
||
class UserFactory(TimestampedSQLModelFactory[User]): | ||
class UserFactory(AuditableSQLModelFactory[User]): | ||
"""User schema factory.""" | ||
|
||
username = Use( | ||
|
@@ -45,7 +45,7 @@ class UserFactory(TimestampedSQLModelFactory[User]): | |
scopes = Use(FrenchDataclassFactory.__random__.sample, list(ScopesEnum), 2) | ||
|
||
|
||
class GroupFactory(TimestampedSQLModelFactory[Group]): | ||
class GroupFactory(AuditableSQLModelFactory[Group]): | ||
"""Group schema factory.""" | ||
|
||
name = Use(FrenchDataclassFactory.__faker__.company) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.