File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ public function getColumns(string $table): array
9191 a.atttypmod-4 AS character_maximum_length,
9292 NOT a.attnotnull AS is_nullable,
9393 a.attnum AS ordinal_position,
94- pg_get_expr(adef.adbin, adef.adrelid) AS column_default
94+ pg_get_expr(adef.adbin, adef.adrelid) AS column_default,
95+ CASE WHEN a.attidentity IN ('a', 'd') THEN 'YES' ELSE 'NO' END AS is_identity
9596 FROM
9697 pg_attribute a
9798 JOIN pg_type ON a.atttypid = pg_type.oid
@@ -116,7 +117,7 @@ public function getColumns(string $table): array
116117 'size ' => $ size > 0 ? $ size : null ,
117118 'nullable ' => $ row ['is_nullable ' ] === 'YES ' || $ row ['is_nullable ' ] === 't ' || $ row ['is_nullable ' ] === true ,
118119 'default ' => $ row ['column_default ' ],
119- 'autoincrement ' => str_starts_with ($ row ['column_default ' ] ?? '' , 'nextval( ' ),
120+ 'autoincrement ' => $ row [ ' is_identity ' ] === ' YES ' || str_starts_with ($ row ['column_default ' ] ?? '' , 'nextval( ' ),
120121 'vendor ' => $ row ,
121122 ];
122123 }
You can’t perform that action at this time.
0 commit comments