Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix: 193 database corruption (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch authored Jul 4, 2023
1 parent b1c5787 commit d3576c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrations/versions/c058421705ec_.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def upgrade():

try:
filesInUploadFolder = [f for f in listdir(UPLOAD_FOLDER) if isfile(join(UPLOAD_FOLDER, f))]
files = [File(filename=f) for f in filesInUploadFolder]
files = [File(filename=f) for f in filesInUploadFolder if not File.query.filter(File.filename == f).first()]

session.bulk_save_objects(files)
session.commit()
Expand Down

0 comments on commit d3576c6

Please sign in to comment.