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 @@ -139,7 +139,7 @@ export class SpannerDriver implements Driver {
139139 deleteDateNullable : true ,
140140 version : "int64" ,
141141 treeLevel : "int64" ,
142- migrationId : "int64 " ,
142+ migrationId : "string " ,
143143 migrationName : "string" ,
144144 migrationTimestamp : "int64" ,
145145 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"
@@ -464,7 +466,9 @@ export class MigrationExecutor {
464466 . migrationId ,
465467 } ) ,
466468 isGenerated : true ,
467- generationStrategy : "increment" ,
469+ generationStrategy : this . connection . driver . options . type === "spanner"
470+ ? "uuid"
471+ : "increment" ,
468472 isPrimary : true ,
469473 isNullable : false ,
470474 } ,
@@ -616,6 +620,12 @@ export class MigrationExecutor {
616620 values [ "timestamp" ] = migration . timestamp
617621 values [ "name" ] = migration . name
618622 }
623+
624+ if ( this . connection . driver . options . type === "spanner" ) {
625+ // spanner cannot auto generate id's so need to generate ids when inserting a migration
626+ values [ "id" ] = uuidv4 ( )
627+ }
628+
619629 if ( this . connection . driver . options . type === "mongodb" ) {
620630 const mongoRunner = queryRunner as MongoQueryRunner
621631 await mongoRunner . databaseConnection
You can’t perform that action at this time.
0 commit comments