Hasura v1.0.0-beta.9 Release Notes

Release Date: 2019-10-31 // over 4 years ago
  • ๐Ÿ”„ 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 appliedhasura 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)