Skip to content

Commit

Permalink
db table export update
Browse files Browse the repository at this point in the history
  • Loading branch information
mjstealey committed Jan 15, 2025
1 parent 5af9deb commit 8666fa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions server/swagger_server/backup/utils/db_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def dump_announcements_data():
- link = db.Column(db.String())
- modified = db.Column(db.DateTime(timezone=True), nullable=True, onupdate=datetime.now(timezone.utc))
- modified_by_uuid = db.Column(db.String(), nullable=True)
- sequence = db.Column(db.Integer(), nullable=True)
- start_date = db.Column(db.DateTime(timezone=True), nullable=False)
- title = db.Column(db.String(), nullable=False)
- uuid = db.Column(db.String(), primary_key=False, nullable=False)
Expand Down Expand Up @@ -156,6 +157,7 @@ def dump_announcements_data():
'link': a.link,
'modified': normalize_date_to_utc(date_str=str(a.modified), return_type='str'),
'modified_by_uuid': str(a.modified_by_uuid),
'sequence': a.sequence,
'start_date': normalize_date_to_utc(date_str=str(a.start_date), return_type='str'),
'title': a.title,
'uuid': str(a.uuid)
Expand Down
2 changes: 1 addition & 1 deletion server/swagger_server/backup/utils/db_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def restore_announcements_data():
stmt = insert(db.Table('announcements')).values(
announcement_type=a.get('announcement_type'),
background_image_url=a.get('background_image_url') if a.get('background_image_url') else None,
button=a.get('button'),
button=a.get('button') if a.get('button') else None,
content=a.get('content'),
created=normalize_date_to_utc(a.get('created')) if a.get('created') else None,
created_by_uuid=a.get('created_by_uuid'),
Expand Down

0 comments on commit 8666fa2

Please sign in to comment.