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

comment status change migration #2974

Closed
wants to merge 4 commits into from

Conversation

grvsachdeva
Copy link
Member

@grvsachdeva grvsachdeva commented Jul 3, 2018

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@ghost ghost assigned grvsachdeva Jul 3, 2018
@ghost ghost added the in progress label Jul 3, 2018
@grvsachdeva
Copy link
Member Author

@jywarren could you please help me here. Thanks!

@jywarren
Copy link
Member

jywarren commented Jul 3, 2018

I'll try to take a look later today - in the meantime, maybe @publiclab/reviewers could offer some assistance?


create_table "answer_selections", force: true do |t|
create_table "answer_selections", force: :cascade do |t|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe @Souravirus has thoughts on this and other edits to the schema example file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this change looks good to me

def up
Comment.all.each do |comment|
comment.status = 1
comment.save({})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the {} required? Were you able to test this out locally?

In general it looks good to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, migration worked locally.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gauravano i'm curious, what's the purpose of this comment.status = 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @siaw23, actually to make spam moderation system for comments, comments would come with 2 status values status = 1 for valid and status = 0 for spam.

@jywarren
Copy link
Member

jywarren commented Jul 3, 2018

Error is: Mysql2::Error: BLOB/TEXT column 'params' used in key specification without a key length

Ah, i think the changes to the schema file are overly broad -- and does this migration affect the schema? I think it may not except for the timestamp, right?

@grvsachdeva
Copy link
Member Author

yes, it shouldn't affect schema, but on running rake db:migrate on my system. I am getting all these changes. Should I just change the timestamp?

@grvsachdeva
Copy link
Member Author

@jywarren I opened a new PR for migration at #3006 . Please review. Thanks!

@grvsachdeva grvsachdeva closed this Jul 7, 2018
@ghost ghost removed the in progress label Jul 7, 2018
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

Successfully merging this pull request may close these issues.

4 participants