Skip to content

Refactor fixures as entities rather than sql #31

@tacman

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.

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