Skip to content

Installation: db:prepare with pre-created databases #45

@pglombardo

Description

@pglombardo

I just deployed solid_cable (latest) to production and hit a few problems. The largest of which was this this from the README:

Then run db:prepare in production to ensure the database is created and the schema is loaded.

db:prepare will only execute if the database doesn't exist.

Problem

For those who use managed databases, the DB is pre-created and the path forward isn't clear.

So I had an empty solid_cable DB with no tables causing app failures.

Failed Solution

I tried bin/rails db:schema:load:cable which errored out with:

TypeError Invalid type for configuration. Expected Symbol, String, or Hash. Got nil

which I didn't investigate unfortunately.

Solution

Copying db/cable_schema.rb to a migration in db/cable_migrate resolved the issue for me.

I'm not sure if this was the best path to resolution but I wanted to point out the obstacle that likely others will hit.

BTW the same problem scenario exists for solid_cache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions