Ainda não tem acesso? Estude com a gente! Matricule-se
Ainda não tem acesso? Estude com a gente! Matricule-se

Depois que eu clico em adicionar aparece essa mensagem

Illuminate \ Database \ QueryException (HY000) SQLSTATE[HY000]: General error: 1 no such table: series (SQL: insert into "series" ("nome") values (teste)) Previous exceptions SQLSTATE[HY000]: General error: 1 no such table: series (HY000)

/Users/cpb/Desktop/Cadastro/controle-series/vendor/laravel/framework/src/Illuminate/Database/Connection.php

 * @param  array     $bindings
 * @param  \Closure  $callback
 * @return mixed
 *
 * @throws \Illuminate\Database\QueryException
 */
protected function runQueryCallback($query, $bindings, Closure $callback)
{
    // To execute the statement, we'll simply call the callback, which will actually
    // run the SQL against the PDO connection. Then we can calculate the time it
    // took to execute and log the query SQL, bindings and time in our memory.
    try {
        $result = $callback($query, $bindings);
    }

    // If an exception occurs when attempting to run a query, we'll format the error
    // message to include the bindings with SQL, which will make this exception a
    // lot more helpful to the developer instead of just the database's errors.
    catch (Exception $e) {
        throw new QueryException(
            $query, $this->prepareBindings($bindings), $e
        );
    }

    return $result;
}

/**
 * Log a query in the connection's query log.
 *
 * @param  string  $query
 * @param  array   $bindings
 * @param  float|null  $time
 * @return void
 */
public function logQuery($query, $bindings, $time = null)
{
    $this->event(new QueryExecuted($query, $bindings, $time, $this));

    if ($this->loggingQueries) {

Arguments "SQLSTATE[HY000]: General error: 1 no such table: series (SQL: insert into "series" ("nome") values (teste))"

4 respostas

Olá, Alan.

Você rodou as migrations com sucesso?

Quando eu rodei as migrations, me retornou está mensagem:

Illuminate\Database\QueryException : Database (/Users/cpb/Desktop/Cadastro/controle-series/database/database.sqlite) does not exist. (SQL: PRAGMA foreign_keys = ON;)

at /Users/cpb/Desktop/Cadastro/controle-series/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 InvalidArgumentException::("Database (/Users/cpb/Desktop/Cadastro/controle-series/database/database.sqlite) does not exist.") /Users/cpb/Desktop/Cadastro/controle-series/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:34

2 Illuminate\Database\Connectors\SQLiteConnector::connect(["sqlite", "/Users/cpb/Desktop/Cadastro/controle-series/database/database.sqlite", "", "sqlite"]) /Users/cpb/Desktop/Cadastro/controle-series/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:218

Please use the argument -v to see more details.

Eu realizo o curso com o Code, mac os.

O problema é o mesmo que o deste post: https://cursos.alura.com.br/forum/topico-php-artisan-migrate-me-retorna-essa-mensagem-abaixo-86470

Vamos dar continuidade por lá, ok?

Forte abraço! :-D