Skip to content

Releases: fabianlindfors/reshape

Reshape 0.7.0

21 Jan 22:35
Compare
Choose a tag to compare

This release brings a major new feature in the form of complex migrations that can span multiple tables. When creating tables as well as adding and removing columns, the up and down options can now be used to move and transforms data across tables. With this, you can for example move a column from one table to another, or transform a 1:N relationship into N:M, all with zero downtime of course. Check out the examples in the documentation to learn how to use it.

Features:

  • Added support for complex changes that span multiple tables to create_table, add_column and remove_column actions

Improvements:

  • Added support for user defined types across actions

Fixed:

  • Fixed issue where a migration would continue even if an action failed

Reshape 0.6.1

03 Aug 15:04
Compare
Choose a tag to compare

Fixes:

  • Fixed issue where migrations would not be sorted naturally by their file names. 10_test.toml would for example be sorted before 1_test.toml. The issue has also been fixed across all helper libraries.

Reshape 0.6.0

22 Apr 09:24
Compare
Choose a tag to compare

On top of the changes below, we have also introduced a new helper library for applications written in Rust. Using this library, you can embed the correct schema query directly in your application with a macro.

Features:

  • Added new custom action for writing custom SQL in migrations. This action doesn't offer any zero-downtime guarantees and should be used with caution.

Changes:

All CLI commands have been renamed to make them more intuitive and readable. The old commands are still available but they have been deprecated and will be removed in a future version. The changes are:

  • reshape migrate -> reshape migration start
  • reshape complete -> reshape migration complete
  • reshape abort -> reshape migration abort
  • reshape generate-schema-query -> reshape schema-query

Reshape 0.5.1

05 Feb 21:23
Compare
Choose a tag to compare

This small release removes the remove subcommand from the CLI. This command would remove all data in a database together with any data stored by Reshape. The command was removed as it wasn't very useful and potentially dangerous.

Fixes:

  • Fixed issue where changing the nullability of a column using alter_column wouldn't work

Reshape 0.5.0

03 Feb 23:20
Compare
Choose a tag to compare

Features:

  • Added new remove_foreign_key action
  • Environment variables for connection options will now be automatically loaded from a .env file if it exists
  • Reshape can now be adopted for an existing application and database without downtime.

Improvements:

  • Added a lock timeout to avoid blocking other queries when attempting to acquire locks which can cause downtime. This can occur if a long-running query stops Reshape from acquiring the locks it needs. Reshape will attempt to acquire locks for up to one second before trying again.
  • Added automatic retries for all queries to improve handling of intermittent errors, such as connectivity issues
  • Added environment variables for all connection options. The POSTGRES_URL variable has also been renamed to DB_URL.
  • Added new --version flag to print the currently installed version

Fixes:

  • Fixed issue where --database flag wouldn't work

Reshape 0.4.0

24 Jan 10:57
Compare
Choose a tag to compare

Features:

  • Foreign keys can now be created using the new add_foreign_key action
  • Enum types can now be created and removed using the new create_enum and remove_enum actions

Improvements:

  • When removing a column using remove_column, any indices covering the column will now be safely dropped without locking

Fixes:

  • Fixed issue where foreign keys in a create_table action couldn't refer to tables that are being renamed or columns that are being changed in the same migration.

Reshape 0.3.1

16 Jan 22:09
Compare
Choose a tag to compare

Improvements:

  • alter_column now supports columns which are part of unique indices. The value after the migration has been applied must still be unique.
  • alter_column now supports columns which are part of non-B-tree indices.

Fixes:

  • Fixed issue where alter_column had to have the changes key set even if it was empty.

Reshape 0.3.0

14 Jan 12:00
Compare
Choose a tag to compare

This release is not backwards compatible with earlier versions. It contains changes to to the format of add_index migration files and the internal state. The internal format is (hopefully) stable from this version but the migration file format is still open for change. This means that you might have to update any existing migration files for a later version.

Features:

  • An error will now be thrown if a Reshape instance tries to connect to a database that another instance is already in the process of modifying
  • add_index can now create unique indices
  • add_index can now create indices of different types than the default B-tree. All available index types in Postgres are supported.

Improvements:

  • alter_column will now ensure any indices for the altered column persist through the migration. Previously this didn't work as Reshape creates a temporary column, losing any indices. The existing indices will now be cloned to the temporary column and the old indices will be gracefully dropped without downtime.

Reshape 0.2.0

12 Jan 12:36
Compare
Choose a tag to compare

Features:

  • alter_column can now change the default value of a column
  • Indexes can now be removed using the new remove_index action

Improvements:

  • Reduced the usage of transactions when completing transactions. Transactions are now held for a much shorter time, decreasing the risk of interfering with other queries. Most migrations also no longer require a transaction at all when completing.
  • Removed usage of transactions when aborting a migration. This decreases the risk of an abort interfering with other queries.
  • When aborting an add_index migration, the index will now be removed concurrently which avoids locking up the table.

Reshape 0.1.1

05 Jan 13:49
Compare
Choose a tag to compare

Changes:

  • Fixed issue where foreign keys had to be specified when creating a table
  • Fixed issue where alter_column migration couldn't be used
  • Fixed issue where a remove_column migration couldn't be aborted
  • Fixed issue where aborts would fail if multiple migrations or multiple actions were aborted
  • Fixed issue where an abort would mess up the tracking of previously applied migrations