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

feat(schema): rework schema diffing #1641

Merged
merged 1 commit into from
Apr 16, 2021
Merged

feat(schema): rework schema diffing #1641

merged 1 commit into from
Apr 16, 2021

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Apr 4, 2021

This commit introduces new schema diffing capabilitites. Instead of shared code for
creating and altering tables, we now build schema objects from entities and existing
schema, and compare those (this will later allow to create down migrations too).

  • Better mapping - adds mapped types to abstract most of the column types (e.g. { type: t.decimal })
  • FK diffing
  • Proper index diffing (before we compared just names)
  • Custom index expressions
  • Comment diffing
  • Column length diffing (e.g. numeric(10,2) or varchar(100))
  • Changing PK types
  • Schena/namespace diffing (posgtres only)

Closes #1486
Closes #1518
Closes #579
Closes #1559
Closes #1602
Closes #1480
Closes #1687

@lgtm-com
Copy link

lgtm-com bot commented Apr 4, 2021

This pull request introduces 6 alerts when merging 63ee3c0 into cb5b25c - view on LGTM.com

new alerts:

  • 5 for Unused variable, import, function or class
  • 1 for Unused loop iteration variable

@B4nan B4nan force-pushed the schema-diffing branch 5 times, most recently from 8c12b91 to da608a5 Compare April 5, 2021 00:18
@B4nan B4nan mentioned this pull request Apr 6, 2021
48 tasks
@B4nan B4nan force-pushed the schema-diffing branch 5 times, most recently from 01c5a05 to 9e39a8e Compare April 7, 2021 20:44
@B4nan B4nan force-pushed the schema-diffing branch 7 times, most recently from 3235fe1 to e5b8388 Compare April 15, 2021 20:40
This commit introduces new schema diffing capabilitites. Instead of shared code for
creating and altering tables, we now build schema objects from entities and existing
schema, and compare those (this will later allow to create down migrations too).
@lgtm-com
Copy link

lgtm-com bot commented Apr 16, 2021

This pull request introduces 3 alerts and fixes 1 when merging f2bc957 into 54ca87e - view on LGTM.com

new alerts:

  • 3 for Polynomial regular expression used on uncontrolled data

fixed alerts:

  • 1 for Polynomial regular expression used on uncontrolled data

@B4nan B4nan marked this pull request as ready for review April 16, 2021 21:12
@B4nan B4nan merged commit 05f15a3 into master Apr 16, 2021
@B4nan B4nan deleted the schema-diffing branch April 16, 2021 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment