File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -78,17 +78,17 @@ public static function process(
78
78
$ column = $ table_definition ->columns [$ column_name ];
79
79
80
80
if ($ column instanceof IntegerColumn && $ column ->isAutoIncrement ()) {
81
- $ conn ->getServer ()->addAutoIncrementMinValue (
81
+ $ last_incremented_value = $ conn ->getServer ()->addAutoIncrementMinValue (
82
82
$ database ,
83
83
$ table_name ,
84
84
$ column_name ,
85
85
$ value
86
86
);
87
- }
88
- }
89
87
90
- if (\count ($ table_definition ->primaryKeyColumns ) === 1 && $ conn ->lastInsertId () === "0 " ) {
91
- $ conn ->setLastInsertId ((string ) $ row [$ table_definition ->primaryKeyColumns [0 ]]);
88
+ if ($ conn ->lastInsertId () === "0 " ) {
89
+ $ conn ->setLastInsertId ((string )$ last_incremented_value );
90
+ }
91
+ }
92
92
}
93
93
94
94
$ table [] = $ row ;
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ public function addAutoIncrementMinValue(
241
241
string $ table_name ,
242
242
string $ column_name ,
243
243
int $ value
244
- ) : void {
244
+ ) : int {
245
245
$ table_definition = $ this ->getTableDefinition ($ database_name , $ table_name );
246
246
$ table = $ this ->databases [$ database_name ][$ table_name ] ?? null ;
247
247
@@ -253,7 +253,7 @@ public function addAutoIncrementMinValue(
253
253
$ table = $ this ->databases [$ database_name ][$ table_name ] = new TableData ();
254
254
}
255
255
256
- $ table ->autoIncrementCursors [$ column_name ] = max (
256
+ return $ table ->autoIncrementCursors [$ column_name ] = max (
257
257
$ table ->autoIncrementCursors [$ column_name ] ?? 0 ,
258
258
$ value
259
259
);
You can’t perform that action at this time.
0 commit comments