uw-ictd / haulage

A single-node tool for measuring and logging network usage to allow billing and analysis
Mozilla Public License 2.0
22 stars 5 forks source link

currencies database table conflicts with the main CoLTE project #25

Closed matt9j closed 3 years ago

matt9j commented 3 years ago

With https://github.com/uw-ictd/colte/pull/106, the colte database model is responsible for the currencies table in the shared database. Unfortunately, I made a rookie mistake and re-used the same table name in the colte project, which is expected in many legacy deployments to connect to the same database as haulage. This creates an issue where the currencies table may already be present in the database if any of the colte services have run, causing the early haulage migrations to fail. Since sqlx applies all migrations iteratively, the early migrations creating the currencies table, which is later dropped by haulage, will conflict and cause the migration chain to fail. If all haulage migrations are run first there is no issue, but this cannot be guaranteed in real world deployment.