[openstreetmap/openstreetmap-website] The database-schema is faulty (#2211)

Stefan Steiger notifications at github.com
Tue Apr 16 08:10:23 UTC 2019


https://raw.githubusercontent.com/openstreetmap/openstreetmap-website/master/db/structure.sql

> Error 1750
> The column "users.id" doesn't have the same data-type as "client_applications.user_id"-Spalte im 
> The constraint or index couldn't be created. See above error. 

users.id is bigint, but the references to users.id are int. 
This is wrong ! 
Same thing with note_comments.

```
ALTER TABLE client_applications ADD CONSTRAINT client_applications_user_id_fkey FOREIGN KEY ("user_id") REFERENCES users(id);
ALTER TABLE issue_comments ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY ("user_id") REFERENCES users(id);
ALTER TABLE issues ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id);
ALTER TABLE issues ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES users(id);
ALTER TABLE issues ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id);
ALTER TABLE oauth_tokens ADD CONSTRAINT oauth_tokens_user_id_fkey FOREIGN KEY ("user_id") REFERENCES users(id);
ALTER TABLE reports ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY ("user_id") REFERENCES users(id);

ALTER TABLE note_comments ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES notes(id);
```



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190416/8e694277/attachment.html>


More information about the rails-dev mailing list