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
2
2
3
3
on :
4
4
push :
5
- branches : ["master "]
5
+ branches : ["main "]
6
6
pull_request :
7
- branches : ["master "]
7
+ branches : ["main "]
8
8
9
9
jobs :
10
10
build :
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export class SpannerDriver implements Driver {
140
140
deleteDateNullable : true ,
141
141
version : "int64" ,
142
142
treeLevel : "int64" ,
143
- migrationId : "int64 " ,
143
+ migrationId : "string " ,
144
144
migrationName : "string" ,
145
145
migrationTimestamp : "int64" ,
146
146
cacheId : "string" ,
Original file line number Diff line number Diff line change
1
+ import { v4 as uuidv4 } from "uuid"
2
+
1
3
import { Table } from "../schema-builder/table/Table"
2
4
import { DataSource } from "../data-source/DataSource"
3
5
import { Migration } from "./Migration"
@@ -515,7 +517,9 @@ export class MigrationExecutor {
515
517
. migrationId ,
516
518
} ) ,
517
519
isGenerated : true ,
518
- generationStrategy : "increment" ,
520
+ generationStrategy : this . connection . driver . options . type === "spanner"
521
+ ? "uuid"
522
+ : "increment" ,
519
523
isPrimary : true ,
520
524
isNullable : false ,
521
525
} ,
@@ -665,6 +669,12 @@ export class MigrationExecutor {
665
669
values [ "timestamp" ] = migration . timestamp
666
670
values [ "name" ] = migration . name
667
671
}
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
+
668
678
if ( this . connection . driver . options . type === "mongodb" ) {
669
679
const mongoRunner = queryRunner as MongoQueryRunner
670
680
await mongoRunner . databaseConnection
You can’t perform that action at this time.
0 commit comments