File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ name: Deploy Player
22
33on :
44 push :
5- branches : ["master "]
5+ branches : ["main "]
66 pull_request :
7- branches : ["master "]
7+ branches : ["main "]
88
99jobs :
1010 build :
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export class SpannerDriver implements Driver {
140140 deleteDateNullable : true ,
141141 version : "int64" ,
142142 treeLevel : "int64" ,
143- migrationId : "int64 " ,
143+ migrationId : "string " ,
144144 migrationName : "string" ,
145145 migrationTimestamp : "int64" ,
146146 cacheId : "string" ,
Original file line number Diff line number Diff line change 1+ import { v4 as uuidv4 } from "uuid"
2+
13import { Table } from "../schema-builder/table/Table"
24import { DataSource } from "../data-source/DataSource"
35import { Migration } from "./Migration"
@@ -515,7 +517,9 @@ export class MigrationExecutor {
515517 . migrationId ,
516518 } ) ,
517519 isGenerated : true ,
518- generationStrategy : "increment" ,
520+ generationStrategy : this . connection . driver . options . type === "spanner"
521+ ? "uuid"
522+ : "increment" ,
519523 isPrimary : true ,
520524 isNullable : false ,
521525 } ,
@@ -665,6 +669,12 @@ export class MigrationExecutor {
665669 values [ "timestamp" ] = migration . timestamp
666670 values [ "name" ] = migration . name
667671 }
672+
673+ if ( this . connection . driver . options . type === "spanner" ) {
674+ // spanner cannot auto generate id's so need to generate ids when inserting a migration
675+ values [ "id" ] = uuidv4 ( )
676+ }
677+
668678 if ( this . connection . driver . options . type === "mongodb" ) {
669679 const mongoRunner = queryRunner as MongoQueryRunner
670680 await mongoRunner . databaseConnection
You can’t perform that action at this time.
0 commit comments