Skip to content

Conversation

@appleboy
Copy link
Member

@appleboy appleboy commented Apr 19, 2017

  • Add download count field in attachment table. See GitHub API
  • Add unit testing.

@strk
Copy link
Member

strk commented Apr 19, 2017

It takes a migration to add that new field, right ?

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 19, 2017
@appleboy
Copy link
Member Author

@strk Yes.

Copy link
Member

@bkcsoft bkcsoft left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

assert.NoError(t, PrepareTestDatabase())

attachment, err := GetAttachmentByUUID("1234567890")
assert.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

assert.Equal(t, attachment.DownloadCount, int64(0)) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bkcsoft Done!

Copy link
Member Author

Choose a reason for hiding this comment

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

See 8278ac9

@appleboy appleboy changed the title feat: add download count field and unit testing. feat: add download count field and unit testing for attachment. Apr 19, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Apr 19, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 19, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 19, 2017
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 19, 2017
@strk
Copy link
Member

strk commented Apr 19, 2017

isn't this still lacking a migration ?

CommentID int64
ReleaseID int64 `xorm:"INDEX"`
Name string
DownloadCount int64
Copy link
Member

Choose a reason for hiding this comment

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

Instead of migration, do this:

  DownloadCount int64 `xorm:"DEFAULT 0"`

Copy link
Member Author

Choose a reason for hiding this comment

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

Done e35bbb2

Copy link
Member

Choose a reason for hiding this comment

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

I remember @lunny calling for always adding a migration, not sure why

Copy link
Member

Choose a reason for hiding this comment

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

It's better to do that. I think we can begin to ask all schema changes should use https://github.com/go-xorm/xorm/tree/master/migrate

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@lunny
Copy link
Member

lunny commented Apr 20, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 20, 2017
@appleboy appleboy merged commit fa2a513 into go-gitea:master Apr 20, 2017
@appleboy appleboy deleted the attachment branch April 20, 2017 02:31
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants