Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the migration script more robust #675

Merged
merged 6 commits into from
Nov 28, 2024
Merged

Conversation

goto-bus-stop
Copy link
Member

MongoDB is schema-less, so it can contain arbitrary stuff in theory. After the first few months we've been quite diligent about keeping models compatible, but for WLK, there's some very old data in MongoDB that doesn't quite follow the current schema.

This patches the migration script to support that sort of bad data, including:

  • Duplicate entries for the same media
  • Missing createdAt and updatedAt timestamps (defaulted to the current date)
  • Missing end property for playlist item (only one case, defaulting to 0)

Migration took about 2 minutes to run on my machine. Not ideal, but fine, I think. If there's even any other servers out there today they won't have nearly as much data as WLK does.

@coveralls
Copy link

coveralls commented Nov 26, 2024

Coverage Status

coverage: 82.418% (-0.4%) from 82.768%
when pulling 9931bfa on keep-migrating
into 9a88ab0 on default.

@goto-bus-stop goto-bus-stop merged commit 888ef62 into default Nov 28, 2024
12 of 14 checks passed
@goto-bus-stop goto-bus-stop deleted the keep-migrating branch November 28, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants