Releases: fabianlindfors/reshape
Reshape 0.7.0
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
andremove_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
Fixes:
- Fixed issue where migrations would not be sorted naturally by their file names.
10_test.toml
would for example be sorted before1_test.toml
. The issue has also been fixed across all helper libraries.
Reshape 0.6.0
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
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
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 toDB_URL
. - Added new
--version
flag to print the currently installed version
Fixes:
- Fixed issue where
--database
flag wouldn't work
Reshape 0.4.0
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
andremove_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
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 thechanges
key set even if it was empty.
Reshape 0.3.0
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 indicesadd_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
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
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