Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor fixures as entities rather than sql #31

Open
tacman opened this issue Mar 15, 2024 · 2 comments
Open

Refactor fixures as entities rather than sql #31

tacman opened this issue Mar 15, 2024 · 2 comments

Comments

@tacman
Copy link

tacman commented Mar 15, 2024

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.

@stephanediondev
Copy link
Owner

I made a quick test, even the command bin/console doctrine:schema:create doesn't work with SQLite

@tacman
Copy link
Author

tacman commented Mar 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants