Skip to content

mix ecto.migrate creates an encrypted db, mix ecto.create doesn't #207

@aus70

Description

@aus70

when using sqlcipher, the mix ecto.migrate command (after mix ecto.create) results in the following error:

[error] GenServer #PID<0.372.0> terminating
** (MatchError) no match of right hand side value: {:error, "file is not a database"}
    (exqlite 0.10.1) lib/exqlite/connection.ex:325: Exqlite.Connection.get_pragma/2
    (exqlite 0.10.1) lib/exqlite/connection.ex:334: Exqlite.Connection.maybe_set_pragma/3
    (exqlite 0.10.1) lib/exqlite/connection.ex:428: Exqlite.Connection.do_connect/2
    (db_connection 2.4.2) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Exqlite.Connection

interestingly, using mix ecto.migrate right after mix ecto.drop results in the following error:

[error] Exqlite.Connection (#PID<0.372.0>) failed to connect: ** (Exqlite.Error) database is locked

but immediately afterwards the db is created, the migration is successful and the db is correctly encrypted. Is this the expected behavior? How come mix ecto.migrate creates the db?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions