Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/models/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ func (app *App) Authorities(txn gorp.SqlExecutor) ([]*Authority, error) {
return authorities, nil
}

func (app *App) GetMaxRevisionByBundleVersion(txn gorp.SqlExecutor, bundleVersion string) (int, error) {
func (app *App) GetMaxRevisionByBundleVersion(txn gorp.SqlExecutor, platformType BundlePlatformType, bundleVersion string) (int, error) {
revision, err := txn.SelectInt(
"SELECT IFNULL(MAX(revision), 0) FROM bundle WHERE app_id = ? AND bundle_version = ?",
"SELECT IFNULL(MAX(revision), 0) FROM bundle WHERE app_id = ? AND platform_type = ? AND bundle_version = ?",
app.Id,
platformType,
bundleVersion,
)
return int(revision), err
Expand Down Expand Up @@ -227,7 +228,7 @@ func (app *App) CreateBundle(dbm *gorp.DbMap, s *GoogleService, bundle *Bundle)

// increment revision number & save application information
err = Transact(dbm, func(txn gorp.SqlExecutor) error {
maxRevision, err := app.GetMaxRevisionByBundleVersion(txn, bundleInfo.Version)
maxRevision, err := app.GetMaxRevisionByBundleVersion(txn, bundle.PlatformType, bundleInfo.Version)
if err != nil {
return err
}
Expand Down