feed
feed copied to clipboard
Refactor fixures as entities rather than sql
app:setup doesn't work with sqlite, I think because you can't send multiple sql statements to ->execute().
My quick hack fix:
if (true === isset($count['total']) && 0 == $count['total']) {
foreach (explode("\n", $file) as $sqlStatement) {
if ($sqlStatement) {
$connection->executeQuery($sqlStatement);
}
}
$output->writeln('<info>Feed data inserted</info>');
but really these shouldn't be sql statements, they should be simple Action entities.
$action = (new Action())->setTitle(..)->setReverse();
Even better would be to check if the action existed first, so that new actions could be added without resetting the database.
I made a quick test, even the command bin/console doctrine:schema:create doesn't work with SQLite
For sqlite, use
bin/console doctrine:database:create bin/console d:sch:update --force
On Sat, Mar 16, 2024 at 12:48 PM Stéphane Dion @.***> wrote:
I made a quick test, even the command bin/console doctrine:schema:create doesn't work with SQLite
— Reply to this email directly, view it on GitHub https://github.com/stephanediondev/feed/issues/31#issuecomment-2002085452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEXIQLLYG4T6U52JY64OEDYYSHV7AVCNFSM6AAAAABEYDJFQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGA4DKNBVGI . You are receiving this because you authored the thread.Message ID: @.***>