hasura / hasura/graphql-engine

`hasura migrate apply` exits with exit code 0 when there is a problem with a single migration

Open
#8,652 0 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.8.0
CLI Version (for CLI related issue): 2.8.0

### Environment

Windows

### What is the expected behaviour?

I have a faulty up.sql migration file, and I am struggling to get Hasura to fail because of it. Right now my CI passed some code that had invalid up.sql

Instead I would like an exit code of >0

### Keywords

cli, ci

### What is the current behaviour?

### How to reproduce the issue?

1. stop and remove all containers and volumes
2. launch fresh pg+hasura (empty db)
3. run 'hasura migrate apply' and see it applies all the migrations
4. echo $? and see it's 0, but we want 1 here

### Any possible solutions?

If pg says thee SQL has an error, bubble this up to CLI and exit

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.