mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-01-30 14:58:30 -06:00
The db:seed command invokes the root seeder DatabaseSeeder which can invoke another seeders using the call() related methods. The root seeder can be set by the --class command-line option and also by the --seeder cmd. line option on some other commands like migrate:fresh/refresh. Seeders can be passed to the Tom application in the similar way like the migrations using the TomApplication::seeders<>() method or through the constructor. Arguments can be passed to the call<>() method, then the seeders run() method will not be called using the virtual dispatch but using the type traits. Of course the arguments passed to the call<>() method has to match with the run() method parameters. Others: - unified usingConnection() across all commands, this functionality was extracted to own class, previous it was a part of the Migrator class, so now every command even if it doesn't use Migrator can call the usingConnection() and it correctly sets a default connection and SQL queries debugging on the base of the -vvv command-line argument - a default database connection is now required, if not set then the exception will be thrown - added example seeders to the Tom application
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
# Migrations and Seeders header files
|
|
# ---
|
|
|
|
# Tom example migrations
|
|
include($$TINYORM_SOURCE_TREE/tests/database/migrations.pri)
|
|
# Or include yours migrations
|
|
#include(/home/xyz/your_project/database/migrations.pri)
|
|
|
|
# Tom example seeders
|
|
include($$TINYORM_SOURCE_TREE/tests/database/seeders.pri)
|
|
# Or include yours seeders
|
|
#include(/home/xyz/your_project/database/seeders.pri)
|
|
|
|
# Dependencies include and library paths
|
|
# ---
|
|
|
|
# MinGW
|
|
win32-g++|win32-clang-g++ {
|
|
# Enable ccache wrapper
|
|
CONFIG *= tiny_ccache
|
|
|
|
# Includes
|
|
# tabulate
|
|
INCLUDEPATH += $$quote(C:/msys64/home/xyz/vcpkg/installed/x64-mingw-dynamic/include/)
|
|
QMAKE_CXXFLAGS += -isystem $$shell_quote(C:/msys64/home/xyz/vcpkg/installed/x64-mingw-dynamic/include/)
|
|
|
|
# Use faster linker
|
|
# CONFIG *= use_lld_linker does not work on MinGW
|
|
QMAKE_LFLAGS *= -fuse-ld=lld
|
|
}
|
|
else:win32-msvc {
|
|
# Includes
|
|
# range-v3 and tabulate
|
|
INCLUDEPATH += $$quote(E:/xyz/vcpkg/installed/x64-windows/include/)
|
|
}
|
|
else:unix {
|
|
# Includes
|
|
# range-v3 and tabulate
|
|
QMAKE_CXXFLAGS += -isystem $$shell_quote(/home/xyz/vcpkg/installed/x64-linux/include/)
|
|
|
|
# Use faster linkers
|
|
clang: CONFIG *= use_lld_linker
|
|
else: CONFIG *= use_gold_linker
|
|
}
|