Conversation
c3f3068 to
494472e
Compare
f6903d5 to
8996dd9
Compare
8996dd9 to
8126b48
Compare
pimeys
commented
Dec 1, 2020
migration-engine/connectors/sql-migration-connector/src/sql_schema_differ.rs
Outdated
Show resolved
Hide resolved
7e4eed5 to
44880c6
Compare
pimeys
commented
Dec 1, 2020
migration-engine/connectors/sql-migration-connector/src/sql_schema_differ.rs
Show resolved
Hide resolved
2c1857b to
39c0ca0
Compare
pimeys
commented
Dec 1, 2020
query-engine/connector-test-kit/src/test/scala/writes/relations/RelationDesignSpec.scala
Outdated
Show resolved
Hide resolved
...ector-test-kit/src/test/scala/writes/topLevelMutations/DeleteManyMutationRelationsSpec.scala
Outdated
Show resolved
Hide resolved
...connector-test-kit/src/test/scala/writes/topLevelMutations/DeleteMutationRelationsSpec.scala
Outdated
Show resolved
Hide resolved
...connector-test-kit/src/test/scala/writes/topLevelMutations/NonEmbeddedUpsertDesignSpec.scala
Show resolved
Hide resolved
...nector-test-kit/src/test/scala/writes/nestedMutations/NestedAtomicNumberOperationsSpec.scala
Outdated
Show resolved
Hide resolved
pimeys
commented
Dec 1, 2020
tomhoule
reviewed
Dec 1, 2020
Contributor
tomhoule
left a comment
There was a problem hiding this comment.
Just starting to review
| #[proc_macro_attribute] | ||
| pub fn test_each_connector_mssql(attr: TokenStream, input: TokenStream) -> TokenStream { | ||
| test_each_connector::test_each_connector_impl(attr, input, true) | ||
| test_each_connector::test_each_connector_impl(attr, input) |
migration-engine/connectors/sql-migration-connector/src/flavour/mssql.rs
Outdated
Show resolved
Hide resolved
tomhoule
reviewed
Dec 1, 2020
migration-engine/connectors/sql-migration-connector/src/flavour/mssql.rs
Show resolved
Hide resolved
86a2d32 to
8230965
Compare
tomhoule
reviewed
Dec 2, 2020
tomhoule
reviewed
Dec 2, 2020
tomhoule
reviewed
Dec 2, 2020
Contributor
tomhoule
left a comment
There was a problem hiding this comment.
Leaving another batch of comments before I move to reviewing the diffing logic. Looking good so far!
| .table_walkers() | ||
| .filter(move |t| t.table_index() != table_index) | ||
| .flat_map(|t| t.foreign_keys()) | ||
| .filter(move |fk| fk.referenced_table().table_index() == table_index) |
migration-engine/connectors/sql-migration-connector/src/flavour/mssql.rs
Outdated
Show resolved
Hide resolved
| .previous() | ||
| .table_walker_at(drop_index.table_index) | ||
| .index_at(drop_index.index_index), | ||
| )], |
| pub name: String, | ||
| pub table_index: usize, | ||
| pub index_index: usize, | ||
| } |
migration-engine/connectors/sql-migration-connector/src/sql_imperative_migration_persistence.rs
Outdated
Show resolved
Hide resolved
|
|
||
| /// Render a `DropIndex` step. | ||
| fn render_drop_index(&self, drop_index: &DropIndex) -> String; | ||
| fn render_drop_index(&self, index: &IndexWalker<'_>) -> String; |
tomhoule
reviewed
Dec 2, 2020
.../migration-engine-tests/tests/diagnose_migration_history/diagnose_migration_history_tests.rs
Outdated
Show resolved
Hide resolved
tomhoule
reviewed
Dec 3, 2020
| .field("table_index", &self.table_index) | ||
| .finish() | ||
| } | ||
| } |
tomhoule
approved these changes
Dec 3, 2020
migration-engine/connectors/sql-migration-connector/src/sql_schema_differ.rs
Show resolved
Hide resolved
migration-engine/migration-engine-tests/tests/migration_tests.rs
Outdated
Show resolved
Hide resolved
migration-engine/migration-engine-tests/tests/migration_tests.rs
Outdated
Show resolved
Hide resolved
For SQL Server, we want to recreate the primary key before recreating a column that's part of it. We do not want this behavior on other databases, thus adding a new flag to the flavour.
Much nicer and following the crate standards this way, without needing to add a completely unnecessary constructor creation...
Also fixes one test to not re-create the whole table (to spawn warnings on SQL Server). The barrel `types::primary` will make the column autocomplete and the next migration removes the identity, spawning a recreation of the whole table.
cdb4b3d to
51e95d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements migrations on Microsoft SQL Server 2017 and 2019. Probably works with earlier versions from at least 2012, but we test only against 2017 and 2019. Removes the gatekeeper for SQL Server from the Migration Engine, and all hacky test macros, unifying the Microsoft databases to the
test_all_connectors.Closes: #813
I'm 99% sure this one fixes issues with
rawqueries containing stored procedures and transactions (reported in our Slack), and some issues we might've fixed with this PR include:Closes: prisma/prisma#4333
Closes: prisma/prisma#4250