[odb-users] Schema Migration not working correctly

Tschoche.Jonas at ddv-mediengruppe.de Tschoche.Jonas at ddv-mediengruppe.de
Tue Jun 16 12:44:37 EDT 2020


I tried it also with my project files. I deleted the odb_changelog and run the same command that is executed by cmake and the table is in changelog, but when I run the same command with the next table header and the odb_changelog is exist - it will nothing append to it.

1. For users:
odb -d mysql --generate-query --generate-schema --schema-format separate --std c++17 --include-regex "%(.*)/(.+)%\$2%" --fkeys-deferrable-mode not_deferrable --profile boost/date-time --profile boost/optional --profile boost/uuid --changelog odb-changelog.log --changelog-dir PROJDIR --default-pointer std::shared_ptr --output-dir PROJDIR/cmake-build-debug/odb_gen --hxx-suffix .hpp --ixx-suffix _inline.hpp --cxx-suffix .cpp --odb-file-suffix _odb -I/usr/local/include PROJDIR/src/datamodel/entities/Users.hpp
PROJDIR/odb-changelog.log: info: initializing changelog with base version 1

2. For madantor:
odb -d mysql --generate-query --generate-schema --schema-format separate --std c++17 --include-regex "%(.*)/(.+)%\$2%" --fkeys-deferrable-mode not_deferrable --profile boost/date-time --profile boost/optional --profile boost/uuid --changelog odb-changelog.log --changelog-dir PROJDIR --default-pointer std::shared_ptr --output-dir PROJDIR/cmake-build-debug/odb_gen --hxx-suffix .hpp --ixx-suffix _inline.hpp --cxx-suffix .cpp --odb-file-suffix _odb -I/usr/local/include PROJDIR/src/datamodel/entities/Madantor.hpp

So I tried with: (I deleted the changelog again)
odb -d mysql --generate-query --generate-schema --schema-format separate --std c++17 --include-regex "%(.*)/(.+)%\$2%" --fkeys-deferrable-mode not_deferrable --profile boost/date-time --profile boost/optional --profile boost/uuid --changelog odb-changelog.log --changelog-dir PROJDIR --default-pointer std::shared_ptr --output-dir PROJDIR/cmake-build-debug/odb_gen --hxx-suffix .hpp --ixx-suffix _inline.hpp --cxx-suffix .cpp --odb-file-suffix _odb -I/usr/local/include PROJDIR /src/datamodel/entities/Users.hpp PROJDIR/src/datamodel/entities/Madantor.hpp

But only the last one is in changelog (Madantor)

Am 16.06.20, 15:21 schrieb "Boris Kolpackov" <boris at codesynthesis.com>:

    odb -d mysql --generate-query --generate-schema --schema-format separate \
      --std c++17 --changelog odb-changelog.log --changelog-dir PROJDIR \
      --output-dir PROJDIR/cmake-build-debug/odb_gen test.hxx




More information about the odb-users mailing list