{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "cargo",
      "subcommand": "build",
      "problemMatcher": ["$rustc"],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "label": "Build Binary"
    },
    {
      "type": "cargo",
      "subcommand": "test",
      "problemMatcher": ["$rustc"],
      "group": {
        "kind": "test",
        "isDefault": true
      },
      "options": {
        "env": {
          "MESSAGE_DB_CONNECTION_URI": "postgresql://postgres:postgres@localhost:5432/postgres"
        }
      },
      "label": "Test Binary",
      "dependsOn": "Run Migrations"
    },
    {
      "type": "cargo",
      "subcommand": "run",
      "problemMatcher": ["$rustc"],
      "label": "Run Binary"
    },
    {
      "type": "shell",
      "command": "refinery migrate -e DB_URI files -p ./migrations",
      "options": {
        "env": {
          "DB_URI": "postgresql://postgres:postgres@localhost:5432/postgres"
        }
      },
      "label": "Run Migrations"
    }
  ]
}
