Skip to content

v1.0.0-beta.9

Pre-release
Pre-release
Compare
Choose a tag to compare
@hasura-bot hasura-bot released this 31 Oct 09:41
· 7898 commits to master since this release

Changelog

Upgrading & downgrading

  • You can upgrade to beta.9 from any version.

  • You can downgrade to beta.8 just by changing the docker image tag.

  • For downgrading to other versions, you may need to manually run SQL scripts if your downgrade path involves a catalog change. Please see this for catalog history.

Read more about upgrading and downgrading.

Updates to CLI & Migrations

New migrations folder structure

Starting with this release, Hasura CLI supports a new directory structure for migrations folder and defaults to that for all new migrations created.

Each migration will get a new directory with the name format timestamp_name and inside the directory, there will be four files:

└── migrations
    ├── 1572237730898_squashed
    │   ├── up.sql
    │   ├── up.yaml
    │   ├── down.yaml
    │   └── down.sql

Existing files old migration format timestamp_name.up|down.yaml|sql will continue to work alongside new migration files.

Squash command

Lots of users have expressed their interest in squashing migrations (see #2724 and #2254) and some even built their own tools to do squash. In this PR, we take a systematic approach to squash migrations.

A new command called migrate squash is introduced. Note that this command is in PREVIEW and the correctness of squashed migration is not guaranteed (especially for down migrations). From our tests, it works for most use cases, but we have found some issues with squashing all the down migrations, partly because the console doesn't generate down migrations for all actions.

Hence, until we add an extensive test suite for squashing, we'll keep the command in preview. We recommend you to confirm the correctness yourself by diffing the SQL and Metadata before and after applying the squashed migrations (we're also thinking about embedding some checks into the command itself).

$ hasura migrate squash --help
(PREVIEW) Squash multiple migrations leading upto the latest one into a single migration file

Usage:
  hasura migrate squash [flags]

Examples:
  # NOTE: This command is in PREVIEW, correctness is not guaranteed and the usage may change.

  # squash all migrations from version 1572238297262 to the latest one:
  hasura migrate squash --from 1572238297262

Flags:
      --from uint             start squashing form this version
      --name string           name for the new squashed migration (default "squashed")
      --delete-source         delete the source files after squashing without any confirmation

Usage:

# squash all migrations from version 1572238297262 to the latest one:
hasura migrate squash --from 1572238297262

# mark the squashed one as applied
hasura migrate apply --version 1572238297262 --skip-execution

See #3072 for more details.

Dry run and diff metadata

A new command. metadata diff is introduced (in PREVIEW) to show comparisons between two different sets of Hasura metadata.

# Show changes between server metadata and the exported metadata file:
hasura metadata diff

# Show changes between server metadata and that in local_metadata.yaml:
hasura metadata diff local_metadata.yaml

# Show changes between metadata from metadata.yaml and metadata_old.yaml:
hasura metadata diff metadata.yaml metadata_old.yaml

This release also adds a --dry-run flag to metadata apply command which will print the diff and exit rather than actually applying the metadata.

This is just a general-purpose diff. A more contextual diff with the understanding of metadata will be added later.

Support for Postgres 12

  • Postgres 12 is now officially supported and all our tests are run against 12.0 also

  • pg_dump binary bundled with the Docker image is updated to 12

Docs

Other changes

  • Build server in CI with optimizations, even in pull requests (#3240)
  • move community tools to separate repos (#3155)
  • add docs page for setting up unauthenticated acess (#3231)