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 @@ -139,7 +139,7 @@ export class SpannerDriver implements Driver {
139
139
deleteDateNullable : true ,
140
140
version : "int64" ,
141
141
treeLevel : "int64" ,
142
- migrationId : "int64 " ,
142
+ migrationId : "string " ,
143
143
migrationName : "string" ,
144
144
migrationTimestamp : "int64" ,
145
145
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"
@@ -464,7 +466,9 @@ export class MigrationExecutor {
464
466
. migrationId ,
465
467
} ) ,
466
468
isGenerated : true ,
467
- generationStrategy : "increment" ,
469
+ generationStrategy : this . connection . driver . options . type === "spanner"
470
+ ? "uuid"
471
+ : "increment" ,
468
472
isPrimary : true ,
469
473
isNullable : false ,
470
474
} ,
@@ -616,6 +620,12 @@ export class MigrationExecutor {
616
620
values [ "timestamp" ] = migration . timestamp
617
621
values [ "name" ] = migration . name
618
622
}
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
+
619
629
if ( this . connection . driver . options . type === "mongodb" ) {
620
630
const mongoRunner = queryRunner as MongoQueryRunner
621
631
await mongoRunner . databaseConnection
You can’t perform that action at this time.
0 commit comments