[openstreetmap/openstreetmap-website] User IDs have inconsistent types in the database (#2211)

Andy Allan notifications at github.com
Wed Apr 17 16:43:25 UTC 2019


> The `structure.sql` file is basically just rough documentation (personally I would get rid of it but people insist on having it) and should not be treated as gospel truth as it often picks up random bits of breakage from people's development databases which have complex histories.

I disagree. The structure.sql should exactly mirror the database structure, and eventually we should  the oldest migrations (e.g. when they are more than 3-4 years old). There's a good explanation of why in the [rails documentation](https://edgeguides.rubyonrails.org/active_record_migrations.html#schema-dumping-and-you) and elsewhere in blog posts. There are migrations written more than a decade ago, for different versions of postgres and different assumptions in active_record and trying to revisit them over and over every few years is unnecessary when we have a structure file that explicitly states the end result.

But of course, it doesn't matter if @tomhughes and I disagree on this topic, so long as we have both the migrations, and the schema, and that they both match the real database! Any discrepancies between the production database and the schema.sql are bugs and definitely need to be fixed. Old migrations can also be changed (e.g. for bigint/integer changes as rails has evolved) but this is a bit more hard work.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2211#issuecomment-484169428
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190417/941b2642/attachment.html>


More information about the rails-dev mailing list