Skip to content

Commit

Permalink
Merge pull request #138 from Jacyking/master
Browse files Browse the repository at this point in the history
pg auto key use "bigserial" when the type is int64_t
  • Loading branch information
Jacyking authored Dec 22, 2023
2 parents da3028e + 1f212bc commit c3ae7b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
working-directory: ${{github.workspace}}/build
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest -C ${{ matrix.configuration }} -j `nproc` -V
run: ctest -C Debug -j `nproc` -V

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
9 changes: 7 additions & 2 deletions include/postgresql.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,14 @@ class postgresql {
}
else if constexpr (std::is_same_v<decltype(item), ormpp_auto_key>) {
if (!has_add_field) {
append(sql, field_name.data(), " ");
if (type_name_arr[i] == "bigint") {
append(sql, field_name.data(), " ", "bigserial");
}
else {
append(sql, field_name.data(), " ", "serial");
}
}
append(sql, " serial primary key");
append(sql, " primary key");
has_add_field = true;
}
else if constexpr (std::is_same_v<decltype(item), ormpp_unique>) {
Expand Down

0 comments on commit c3ae7b4

Please sign in to comment.