How to deploy Rails app with Sqlite DB?

Hi all, I’ve been trying to add a Rails app with sqllite db server but it doesn’t work at all. Somehow I’ve got the app deployed but now the sqlite3 db doesn’t seem to work.

ActionView::Template::Error (SQLite3::SQLException: no such table: businesses: SELECT  "businesses".* FROM "businesses" ORDER BY "businesses"."id" ASC LIMIT ?)

This is the error I get when I visit the web site.
My fly.toml looks like this

# fly.toml file generated for dawn-glitter-6907 on 2022-07-12T10:21:00+05:30

app = "test-app"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

    BUNDLER_VERSION = "1.17.3"
    NODE_VERSION = "14"
    RUBY_VERSION = "2.6.9"

  release_command = "bundle exec rails db:migrate"

  PORT = "3000"
  SERVER_COMMAND = "bundle exec puma -C config/puma.rb"

  allowed_public_ports = []
  auto_rollback = true

  http_checks = []
  internal_port = 3000
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
    hard_limit = 25
    soft_limit = 20
    type = "connections"

    force_https = true
    handlers = ["http"]
    port = 80

    handlers = ["tls", "http"]
    port = 443

    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

  guest_path = "/app/public"
  url_prefix = "/"

Some help would be appreciated.

PS: The only reason I’m deploying the app with sqlite3 db is because of the existing production data is in the db and migrating the data from sqlite to postgresql seemed like a lot of pain.

Hello! I think you need to create + attach a Volume if you want data stored in your SQLite DB to persist across deploys. I didn’t see any [mounts] section in your fly.toml so I think that’s what’s missing. Hope that helps!