Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump diesel_migrations from 1.4.0 to 2.1.0 #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Nov 18, 2024

Bumps diesel_migrations from 1.4.0 to 2.1.0.

Release notes

Sourced from diesel_migrations's releases.

Diesel 2.1.0 contains the contributions of 42 people. More than 380 commits were submitted over a span of 9 months.

This release contains several new features and improves existing features. It introduces support for generating migrations based on the diff between your schema.rs file and your database via Diesel CLI. Diesel derives now provides a #[derive(https://github.com/diesel-rs/diesel/blob/HEAD/MultiConnection)] derive macro that allows to easily combine different database connections into a single enum, which implements Connection on its own. The MySQL backend gets support for upsert queries via the ON DUPLICATE KEYS syntax. Finally we provide new tooling to improve complex error messages generated for common error cases. Check out our changelog for a complete list of changes.

This release wouldn't be possible without the support of our contributors and sponsors. If you want to support diesels development, consider joining the reviewer team, submitting PR's, help writing documentation or sponsor the maintainers.

Migration generation

Diesel CLI now includes support for generating migrations based on the difference of your schema.rs file and your local database. This works as following:

  1. Start editing your schema.rs file, for example by adding your first table:
diesel::table! {
    users {
        id -> Integer,
        name -> Text,
    }
}
  1. Run diesel migration generate my_first_migration --diff-schema --database-url DATABASE_URL
  2. Checkout, verify and possible modify the generated migration:
-- Your SQL goes here
CREATE TABLE `users`(
	`id` INTEGER NOT NULL PRIMARY KEY,
	`name` TEXT NOT NULL
);
  1. Run the migration via diesel migration run --database-url DATABASE_URL

It's important to note that the generated migrations can only contain information that are part of the schema.rs file. This explicitly excludes default value, custom check constraints and similar SQL features. We expect the generated migrations to be a good starting point for writing the actual migration you need, we do not expect them to include all necessary information in all cases or to provide the perfect solution in each scenario.

MultiConnection support

Diesel now includes a #[derive(MultiConnection)] proc macro derive, which allows to easily support more than one database backend in a single application. It can be applied to an enum of different connections:

#[derive(diesel::MultiConnection)]
pub enum AnyConnection {
    Postgresql(diesel::PgConnection),
    Mysql(diesel::MysqlConnection),
    Sqlite(diesel::SqliteConnection),
}
</tr></table> 

... (truncated)

Changelog

Sourced from diesel_migrations's changelog.

[2.1.0] 2023-05-26

Changed

  • The minimal officially supported rustc version is now 1.65.0

Added

  • Added the custom_type_derives config option to customize the derives for SQL type definitions automatically generated by Diesel CLI.
  • Add a #[derive(MultiConnection)] proc-macro that lets you easily implement diesel::Connection for an enum of connections to different database backends.
  • Added a --diff-schema flag to the diesel migration generate command that generates a migration based on the difference between your database and the provided schema.rs file
  • Add a ON CONFLICT (...) DO UPDATE ... [WHERE ...] conditional clause support for PostgreSQL.
  • Add support for MySQL's ON DUPLICATE KEY DO UPDATE syntax through the existing upsert functions.
  • Add ability to define multiple columns in a single distinct_on for PostgreSQL, like: .distinct_on((column_a, column_b)).
  • Added column size restrictions to the generated schema.rs file

[2.0.4] 2023-04-18

Fixed

  • Workaround the missing name resolution in rust-analyzer. This should fix type inference for some diesel queries. (It remains broken for queries containing .filter()/.inner_join()/.left_join(). These require fixes in rust-analyzer itself)
  • Fixed a bug that could lead to inserting null values instead of empty values for custom sqlite types
  • Fixed a bug that could lead to an unexpected panic while providing an out of bounds bind for sql_query in the sqlite backend
  • Fixed some mysql backend specific impl being behind the mysql instead of the mysql_backend feature flag

Added

  • Support for libsqlite3-sys 0.26

[diesel_derives 2.0.2] 2023-03-13

Fixed

  • Fixing the fallout of a breaking change from quote by not using their internal API

[2.0.3] 2023-01-24

Fixed

  • Fixed a bug with our transaction manager implementation that caused by marking transactions as broken which could be recovered.
  • Fixed an issue with the combination of BoxableExpression and order clauses

[2.0.2] 2022-10-11

Fixed

... (truncated)

Commits
  • c5a9f7b Some minor fixup for the diesel_table_macro_syntax_crate
  • cbe9bef Merge pull request #3637 from weiznich/prepare/2.1
  • a0b082b Prepare a 2.1 release
  • d29b7f9 Merge pull request #3628 from omid/multi_column_distinct_on
  • 630731d add more tests + cs
  • 1de31ad Add compile tests and fix CI issues
  • 89dc71f Merge branch 'master' into multi_column_distinct_on
  • d31630a implement missing cases
  • 258d64b Implement field length introspection and make available in schema (#3552)
  • 20e00a4 Provide non-conflicting impls up to a tuple size of 5
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [diesel_migrations](https://github.com/diesel-rs/diesel) from 1.4.0 to 2.1.0.
- [Release notes](https://github.com/diesel-rs/diesel/releases)
- [Changelog](https://github.com/diesel-rs/diesel/blob/master/CHANGELOG.md)
- [Commits](diesel-rs/diesel@v1.4.0...v2.1.0)

---
updated-dependencies:
- dependency-name: diesel_migrations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants