Records all delete when I restart `amber watch`


#1

This is really strange and I’ve never encountered a bug like this.

I run amber db seed and my records are created, I can see my records in the UI, a simple index scaffold.

Then ctrl+c the amber watch, run amber watch again and refresh refresh refresh and suddenly they all vanish!

Why would restarting amber watch cause all my records to disappear?


#2

Amber watch may be running your specs on your development database. In your amber.yml file fount at the root of your project replace the following.

  spec:
    run_commands:
      - crystal spec

With

  spec:
    run_commands:
      - AMBER_ENV=test crystal spec

The issue has been addressed here https://github.com/amberframework/amber/pull/1068