-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anonymisation): add activity_anonymized, activity_version_anonym…
…ized table and query
- Loading branch information
1 parent
d25561f
commit 3c0f8bf
Showing
6 changed files
with
393 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from app import db | ||
from app.models.activity import Activity | ||
|
||
|
||
class ActivityAnonymized(Activity): | ||
backref_base_name = "activity_anonymized" | ||
__mapper_args__ = {"concrete": True} | ||
|
||
id = db.Column(db.Integer, primary_key=True) | ||
type = db.Column(db.String(8), nullable=True) | ||
user_id = db.Column(db.Integer, nullable=True) | ||
submitter_id = db.Column(db.Integer, nullable=True) | ||
mission_id = db.Column(db.Integer, nullable=True) | ||
dismiss_author_id = db.Column(db.Integer, nullable=True) | ||
dismissed_at = db.Column(db.DateTime, nullable=True) | ||
creation_time = db.Column(db.DateTime, nullable=True) | ||
reception_time = db.Column(db.DateTime, nullable=True) | ||
start_time = db.Column(db.DateTime, nullable=True) | ||
end_time = db.Column(db.DateTime, nullable=True) | ||
last_update_time = db.Column(db.DateTime, nullable=True) | ||
last_submitter_id = db.Column(db.Integer, nullable=True) | ||
dismiss_context = db.Column(db.JSON, nullable=True) | ||
|
||
def __repr__(self): | ||
return f"<ActivityAnonymized(id={self.id}, type={self.type}, creation_time={self.creation_time})>" |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from app import db | ||
from app.models.activity_version import ActivityVersion | ||
|
||
|
||
class ActivityVersionAnonymized(ActivityVersion): | ||
backref_base_name = "activity_version_anonymized" | ||
__mapper_args__ = {"concrete": True} | ||
|
||
id = db.Column(db.Integer, primary_key=True) | ||
activity_id = db.Column(db.Integer, nullable=True) | ||
version_number = db.Column(db.Integer, nullable=True) | ||
submitter_id = db.Column(db.Integer, nullable=True) | ||
creation_time = db.Column(db.DateTime, nullable=True) | ||
reception_time = db.Column(db.DateTime, nullable=True) | ||
start_time = db.Column(db.DateTime, nullable=True) | ||
end_time = db.Column(db.DateTime, nullable=True) | ||
context = db.Column(db.JSON, nullable=True) | ||
|
||
def __repr__(self): | ||
return f"<ActivityVersionAnonymized(id={self.id}, activity_id={self.activity_id}, version_number={self.version_number})>" |
Oops, something went wrong.