Skip to content

Refactor fixures as entities rather than sql #31

Description

@tacman

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions