stafftastic / jitsu-chart

MIT License
14 stars 7 forks source link

jitsu 2.6 database migration issue #23

Closed mleklund closed 5 months ago

mleklund commented 6 months ago

upon upgrading migration job failed with:

Defaulted container "jitsu" out of: jitsu, wait-for-tokens (init)
Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database "jitsu", schema "newjitsu" at "jitsu:5432"

⚠️  There might be data loss when applying the changes:

  • A unique constraint covering the columns `[loginProvider,externalId]` on the table `UserProfile` will be added. If there are existing duplicate values, this will fail.

Error: Use the --accept-data-loss flag to ignore the data loss warnings like prisma db push --accept-data-loss

I went and looked at my postgres table, and I indeed had duplicate users in UserProfile. I figured out which were actually being used and deleted the others. I then recreated the migration job with --accept-data-loss.

This is mostly a warning to others, and how I handled the upgrade.

echozio commented 6 months ago

I ended up patching the console deployment and running the migration from there, deleting the job and deploying again.

While I don't want to add this flag by default I'll look into providing a more friendly way to do this than manually editing resources or templates.