From 58b734ef485e10096c81c79d4beb2b4fef0773fa Mon Sep 17 00:00:00 2001 From: m0t0k1ch1 Date: Sat, 28 Feb 2015 23:26:19 +0900 Subject: [PATCH] =?UTF-8?q?platform=5Ftype=20=E3=81=94=E3=81=A8=E3=81=AB?= =?UTF-8?q?=20revision=20=E3=82=92=E6=8C=AF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/app.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/app.go b/app/models/app.go index ae87601..1d9528d 100644 --- a/app/models/app.go +++ b/app/models/app.go @@ -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 @@ -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 }