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

Mismatch between annotations and schema #2235

Closed
gravitystorm opened this issue May 29, 2019 · 3 comments
Closed

Mismatch between annotations and schema #2235

gravitystorm opened this issue May 29, 2019 · 3 comments

Comments

@gravitystorm
Copy link
Collaborator

I've found a mismatch in the types for various columns, between the schema and the annotations. For example, in changeset_comments, changeset_id and author_id have different types:

# == Schema Information
#
# Table name: changeset_comments
#
#  id           :integer          not null, primary key
#  changeset_id :integer          not null
#  author_id    :integer          not null
CREATE TABLE public.changeset_comments (
    id integer NOT NULL,
    changeset_id bigint NOT NULL,
    author_id bigint NOT NULL,

I think that it's the annotations need to be updated, but I'm not certain. I created my local database before b606acb so I'm being cautious as to which one is incorrect. Any thoughts?

To fix, with a known-good database structure, simply run 'bundle exec rake db:migrate' and it will change the annotations.

@gravitystorm
Copy link
Collaborator Author

Ah, it's actually a change in the annotate gem, which showed bigint columns as integers in the version that we used for the first run of annotations. I'm surprised that nobody has encountered this more recently.

@tomhughes
Copy link
Member

Yes I knew there was something going on there but I hadn't got around to investigating yet...

@tomhughes
Copy link
Member

Fixed by #2236.

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

No branches or pull requests

2 participants