Fix linting error

This commit is contained in:
Alessio 2021-11-22 17:03:57 -08:00
parent 5f97014bdc
commit 7f02d6acec
2 changed files with 5 additions and 2 deletions

View File

@ -64,7 +64,7 @@ func (p Profile) check_and_update_version() error {
if ENGINE_DATABASE_VERSION > version { if ENGINE_DATABASE_VERSION > version {
fmt.Printf("Upgrading database from version %d to version %d", version, ENGINE_DATABASE_VERSION) fmt.Printf("Upgrading database from version %d to version %d", version, ENGINE_DATABASE_VERSION)
p.UpgradeFromXToY(version, ENGINE_DATABASE_VERSION) return p.UpgradeFromXToY(version, ENGINE_DATABASE_VERSION)
} }
return nil return nil

View File

@ -25,7 +25,10 @@ func TestVersionUpgrade(t *testing.T) {
} }
persistence.MIGRATIONS = append(persistence.MIGRATIONS, test_migration) persistence.MIGRATIONS = append(persistence.MIGRATIONS, test_migration)
profile.UpgradeFromXToY(persistence.ENGINE_DATABASE_VERSION, persistence.ENGINE_DATABASE_VERSION + 1) err := profile.UpgradeFromXToY(persistence.ENGINE_DATABASE_VERSION, persistence.ENGINE_DATABASE_VERSION + 1)
if err != nil {
panic(err)
}
if !profile.IsTweetInDatabase(test_tweet_id) { if !profile.IsTweetInDatabase(test_tweet_id) {
t.Errorf("Migration should have created the tweet, but it didn't") t.Errorf("Migration should have created the tweet, but it didn't")