@@ -14,7 +14,6 @@ import (
1414	"storj.io/storj/private/migrate" 
1515	"storj.io/storj/shared/dbutil" 
1616	"storj.io/storj/shared/dbutil/pgutil" 
17- 	"storj.io/storj/shared/dbutil/spannerutil" 
1817	"storj.io/storj/shared/tagsql" 
1918)
2019
@@ -66,7 +65,7 @@ func (db *satelliteDB) MigrateToLatest(ctx context.Context) error {
6665	}
6766
6867	switch  db .impl  {
69- 	case  dbutil .Postgres , dbutil .Cockroach :
68+ 	case  dbutil .Postgres , dbutil .Cockroach ,  dbutil . Spanner :
7069		migration  :=  db .ProductionMigration ()
7170		// since we merged migration steps 0-69, the current db version should never be 
7271		// less than 69 unless the migration hasn't run yet 
@@ -82,9 +81,6 @@ func (db *satelliteDB) MigrateToLatest(ctx context.Context) error {
8281		}
8382
8483		return  migration .Run (ctx , db .log .Named ("migrate" ))
85- 	case  dbutil .Spanner :
86- 		// TODO(spanner): add incremental migration support 
87- 		return  migrate .CreateSpanner (ctx , "database" , db .DB , false )
8884	default :
8985		return  migrate .Create (ctx , "database" , db .DB )
9086	}
@@ -124,7 +120,7 @@ func (db *satelliteDBTesting) TestMigrateToLatest(ctx context.Context) error {
124120	}
125121
126122	switch  db .impl  {
127- 	case  dbutil .Postgres , dbutil .Cockroach :
123+ 	case  dbutil .Postgres , dbutil .Cockroach ,  dbutil . Spanner :
128124		migration  :=  db .ProductionMigration ()
129125
130126		dbVersion , err  :=  migration .CurrentVersion (ctx , db .log , db .DB )
@@ -137,14 +133,6 @@ func (db *satelliteDBTesting) TestMigrateToLatest(ctx context.Context) error {
137133			return  ErrMigrateMinVersion .New ("the database must be empty, or be on the latest version (%d)" , dbVersion )
138134		}
139135		return  testMigration .Run (ctx , db .log .Named ("migrate" ))
140- 	case  dbutil .Spanner :
141- 		params , err  :=  spannerutil .ParseConnStr (db .source )
142- 		if  err  !=  nil  {
143- 			return  Error .New ("invalid connection string for Spanner: %w" , err )
144- 		}
145- 
146- 		// TODO(spanner): add incremental migration support 
147- 		return  migrate .CreateSpanner (ctx , "database" , db .DB , params .Emulator )
148136	default :
149137		return  migrate .Create (ctx , "database" , db .DB )
150138	}
0 commit comments