Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@masseelch
Copy link
Collaborator

@masseelch masseelch commented Jun 28, 2022

This PR does 2 things:

  1. Atlas based migration engine is now default while it is still possible to opt-out. The option to opt-out has been deprecated and the migration engine will be removed in a next release.
  2. Atlas engine has two modes to determine the current state of the schema
    1. ModeInspect to inspect a connect database (legacy behavior)
    2. ModeReplay to replay the migration directory and then inspect

Among other things, the recently introduced ent_types file for versioned migrations has been removed and the source of truth is now the inspected database.

  • Documentation

@masseelch masseelch requested a review from a8m June 28, 2022 12:59
@masseelch masseelch force-pushed the migrate/dir-replay branch 7 times, most recently from 718ea11 to e8ba203 Compare July 4, 2022 13:12
@masseelch masseelch changed the title dialect/sql/schema: diff by replaying migration dialect/sql/schema: atlas engine is now default Jul 4, 2022
@masseelch masseelch force-pushed the migrate/dir-replay branch from e8ba203 to fd04ef9 Compare July 4, 2022 19:10
@masseelch masseelch force-pushed the migrate/dir-replay branch from fd04ef9 to 3214083 Compare July 4, 2022 19:12
Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic 🚀

My only concern is the BC for schemas that rely on the generated code (e.g. privacy or hooks) and won't be able to compile and execute the codegen. I'll check this on your branch.

// MigrateOption allows for managing schema configuration using functional options.
type MigrateOption func(*Migrate)
// MigrateOption allows configuring Atlas using functional arguments.
type MigrateOption func(*Atlas)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that you updated also NewMigrate, so that should not break users' code, but I'll verify it locally and update you.

@masseelch masseelch force-pushed the migrate/dir-replay branch from 6dee083 to bdb089e Compare July 5, 2022 06:10
@masseelch masseelch marked this pull request as ready for review July 5, 2022 06:10
Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic Jannik! 💯

@masseelch masseelch merged commit 5b67bda into master Jul 5, 2022
@masseelch masseelch deleted the migrate/dir-replay branch July 5, 2022 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants