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
Fix 909 Update initial data #918
Conversation
I just pushed the commit that updates initial data. few of the tests fails because it has a --- FAIL: Test_tagListRepo_BatchGetObjectTagRelList (0.00s)
tag_rel_repo_test.go:65:
Error Trace: /home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:65
Error: Not equal:
expected: 2
actual : 3
Test: Test_tagListRepo_BatchGetObjectTagRelList
[xorm] [info] 2024/04/23 20:21:07.437924 [SQL] SELECT count(*) FROM `tag_rel` WHERE `tag_id`=? AND `status`=? [10030000000000001 1] - 77.627µs
--- FAIL: Test_tagListRepo_CountTagRelByTagID (0.00s)
tag_rel_repo_test.go:73:
Error Trace: /home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:73
Error: Not equal:
expected: 1
actual : 3
Test: Test_tagListRepo_CountTagRelByTagID
--- FAIL: Test_tagListRepo_GetObjectTagRelWithoutStatus (0.00s)
tag_rel_repo_test.go:93:
Error Trace: /home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:93
Error: Not equal:
expected: 2
actual : 3
Test: Test_tagListRepo_GetObjectTagRelWithoutStatus
tag_rel_repo_test.go:101:
Error Trace: /home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:101
Error: Not equal:
expected: 0
actual : 1
Test: Test_tagListRepo_GetObjectTagRelWithoutStatus
tag_rel_repo_test.go:112:
Error Trace: /home/zahash/source/incubator-answer/internal/repo/repo_test/tag_rel_repo_test.go:112
Error: Not equal:
expected: 1
actual : 3
Test: Test_tagListRepo_GetObjectTagRelWithoutStatus
|
the enhancement is done and ready for review. |
internal/migrations/init.go
Outdated
} | ||
|
||
_, m.err = m.engine.Context(m.ctx).Insert(entity.TagRel{ | ||
CreatedAt: now, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like below, no need to set the time here.
internal/migrations/init.go
Outdated
Title: "What is a tag?", | ||
OriginalText: "When asking a question, we need to choose tags. What are tags and why should I use them?", | ||
ParsedText: "<p>When asking a question, we need to choose tags. What are tags and why should I use them?</p>", | ||
Pin: entity.QuestionPin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The questions don't need to be pinned to the top.
internal/migrations/init.go
Outdated
Show: entity.QuestionShow, | ||
Status: entity.QuestionStatusAvailable, | ||
AnswerCount: 1, | ||
AcceptedAnswerID: a1_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer corresponding to the question does not need to be accepted.
internal/migrations/init.go
Outdated
Title: "What is reputation and how do I earn them?", | ||
OriginalText: "I see that each user has reputation points, What is it and how do I earn them?", | ||
ParsedText: "<p>I see that each user has reputation points, What is it and how do I earn them?</p>", | ||
Pin: entity.QuestionPin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The questions don't need to be pinned to the top.
internal/migrations/init.go
Outdated
Show: entity.QuestionShow, | ||
Status: entity.QuestionStatusAvailable, | ||
AnswerCount: 1, | ||
AcceptedAnswerID: a2_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer corresponding to the question does not need to be accepted.
i think i resolved all the code change requests. can you check? |
Great. Thank you for your contribution. |
fixes #909