diff --git a/api/usersd/pb/javascript/package.json b/api/usersd/pb/javascript/package.json index d2ab26e94..09e03e39a 100644 --- a/api/usersd/pb/javascript/package.json +++ b/api/usersd/pb/javascript/package.json @@ -12,7 +12,11 @@ "api/usersd/pb/usersd_pb.js", "api/usersd/pb/usersd_pb_service.js", "api/usersd/pb/usersd_pb.d.ts", - "api/usersd/pb/usersd_pb_service.d.ts" + "api/usersd/pb/usersd_pb_service.d.ts", + "api/billingd/pb/billingd_pb.js", + "api/billingd/pb/billingd_pb_service.js", + "api/billingd/pb/billingd_pb.d.ts", + "api/billingd/pb/billingd_pb_service.d.ts" ], "dependencies": { "@improbable-eng/grpc-web": "^0.13.0", diff --git a/mongodb/migrations/migrations.go b/mongodb/migrations/migrations.go index 8acd725dc..b2a50c624 100644 --- a/mongodb/migrations/migrations.go +++ b/mongodb/migrations/migrations.go @@ -14,7 +14,7 @@ import ( var ( log = logging.Logger("migrations") - migrateTimeout = time.Minute + migrateTimeout = time.Hour ) var m001 = migrate.Migration{ @@ -97,8 +97,7 @@ var m002 = migrate.Migration{ if cursor.Err() != nil { return cursor.Err() } - //return db.Collection("users").Drop(ctx) - return nil + return db.Collection("users").Drop(ctx) }, Down: func(db *mongo.Database) error { log.Info("migrating 002 down") diff --git a/mongodb/migrations/migrations_test.go b/mongodb/migrations/migrations_test.go index d96f0e59c..a8b0a2f07 100644 --- a/mongodb/migrations/migrations_test.go +++ b/mongodb/migrations/migrations_test.go @@ -87,20 +87,20 @@ func TestMigrations_m002(t *testing.T) { count, err = db.Collection("accounts").CountDocuments(ctx, bson.M{"type": 2}) require.NoError(t, err) assert.Equal(t, 3, int(count)) - //count, err = db.Collection("users").CountDocuments(ctx, bson.M{}) - //require.NoError(t, err) - //assert.Equal(t, 0, int(count)) + count, err = db.Collection("users").CountDocuments(ctx, bson.M{}) + require.NoError(t, err) + assert.Equal(t, 0, int(count)) // Run down - // err = migrate.NewMigrate(db, m002).Down(migrate.AllAvailable) - // require.NoError(t, err) - - //count, err = db.Collection("accounts").CountDocuments(ctx, bson.M{}) - //require.NoError(t, err) - //assert.Equal(t, 3, int(count)) - //count, err = db.Collection("users").CountDocuments(ctx, bson.M{}) - //require.NoError(t, err) - //assert.Equal(t, 3, int(count)) + err = migrate.NewMigrate(db, m002).Down(migrate.AllAvailable) + require.NoError(t, err) + + count, err = db.Collection("accounts").CountDocuments(ctx, bson.M{}) + require.NoError(t, err) + assert.Equal(t, 3, int(count)) + count, err = db.Collection("users").CountDocuments(ctx, bson.M{}) + require.NoError(t, err) + assert.Equal(t, 3, int(count)) } // Test remove buckets_total_size from accounts