Skip to content

chore: reorder v2 migrations folders #8671

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

Merged
merged 24 commits into from
Aug 5, 2025
Merged

Conversation

hrithikesh026
Copy link
Contributor

@hrithikesh026 hrithikesh026 commented Jul 17, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

reordered v2 migrations folders.

  • All misplaced v2 migrations are moved to v2_compatible_migrations directory.
  • Removed Add not null constraints to newly added v2 columns.
  • v2_migrations directory will only contain queries for dropping deprecated v1 columns and tables. And queries to update primary_key constraints on v2 columns. This set of migration will only be run after v1 is deprecated.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Ran just migrate and just migrate_v2 and checked if schema.rs and schema_v2.rs has changed.

1. Create and retrieve MCA.

  1. Create curl.
curl --location 'localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: test_merchant_Y0ZfWfDN9sUUbMjs8anw' \
--header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \
--header 'x-tenant-id: public' \
--header 'authorization: admin-api-key=test_admin' \
--data '{
    "connector_type": "payment_processor",
    "connector_name": "stripe",
    "connector_account_details": {
        "auth_type": "HeaderKey",
        "api_key": "<connector_api_key>"
    },
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtypes": [
                {
                    "payment_method_subtype": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": -1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_subtype": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": -1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
        "account_name": "transaction_processing",
        "pricing_type": "fixed_price",
        "acquirer_bin": "438309",
        "acquirer_merchant_id": "00002000000"
    },
    "frm_configs": null,
    "connector_webhook_details": {
        "merchant_secret": ""
    },
    "profile_id": "pro_wm40wdiluSez3GvEhgUh"
}'
  1. Retrive MCA.
curl --location 'localhost:8080/v2/connector-accounts/mca_OpUAPwOPYsXZUUKNMhAg' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: test_merchant_Y0ZfWfDN9sUUbMjs8anw' \
--header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \
--header 'x-tenant-id: public' \
--header 'authorization: admin-api-key=test_admin'

Response: 2xx response

2. Create and retrieve Customer.

  1. Create customer.
curl --location 'localhost:8080/v2/customers' \
--header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \
--header 'x-tenant-id: public' \
--header 'Content-Type: application/json' \
--header 'authorization: api-key=dev_shfYv8ac2GIlqBl8Qd0WaBqeiNkGuF53bTv0clK1CGR4p28agg0VIuO4j4r4vATm' \
--data-raw '{   
    "merchant_reference_id": "customer_1753776365",
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "First customer",
    "default_billing_address": {
        "line1": "1467",
        "line2": "Harrison Street",
        "line3": "Harrison Street",
        "city": "San Fransico",
        "state": "California",
        "zip": "94122",
        "country": "US",
        "first_name": "joseph",
        "last_name": "Doe"
    },
    "default_shipping_address": {
        "line1": "1467",
        "line2": "Harrison Street",
        "line3": "Harrison Street",
        "city": "San Fransico",
        "state": "California",
        "zip": "94122",
        "country": "US",
        "first_name": "joseph",
        "last_name": "Doe"
    },
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
  1. Retrive Customer.
curl --location 'localhost:8080/v2/customers/12345_cus_0198551f679f7091a036beaf2c013020' \
--header 'x-profile-id: pro_wm40wdiluSez3GvEhgUh' \
--header 'authorization: api-key=dev_shfYv8ac2GIlqBl8Qd0WaBqeiNkGuF53bTv0clK1CGR4p28agg0VIuO4j4r4vATm'

Response: 2xx response.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@hrithikesh026 hrithikesh026 self-assigned this Jul 17, 2025
@hrithikesh026 hrithikesh026 requested review from a team as code owners July 17, 2025 05:00
@hrithikesh026 hrithikesh026 added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 17, 2025
Copy link

semanticdiff-com bot commented Jul 17, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/diesel_models/src/customers.rs  70% smaller
  crates/diesel_models/src/business_profile.rs  50% smaller
  crates/diesel_models/src/refund.rs  44% smaller
  crates/diesel_models/src/schema_v2.rs  25% smaller
  crates/common_enums/src/enums.rs  0% smaller
  crates/diesel_models/src/lib.rs  0% smaller
  crates/diesel_models/src/merchant_connector_account.rs  0% smaller
  crates/diesel_models/src/payment_attempt.rs  0% smaller
  crates/diesel_models/src/payment_intent.rs  0% smaller
  v2_compatible_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/down.sql Unsupported file format
  v2_compatible_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/up.sql Unsupported file format
  v2_compatible_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/down.sql Unsupported file format
  v2_compatible_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/up.sql Unsupported file format
  v2_compatible_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/down.sql Unsupported file format
  v2_compatible_migrations/2025-02-24-053820_add_billing_processor_value_to_connector_type_enum/up.sql Unsupported file format
  v2_compatible_migrations/2025-03-19-080705_payment-method-subtype-optional/down.sql Unsupported file format
  v2_compatible_migrations/2025-03-19-080705_payment-method-subtype-optional/up.sql Unsupported file format
  v2_compatible_migrations/2025-03-25-074512_payment-method-subtype-mandatory/down.sql Unsupported file format
  v2_compatible_migrations/2025-03-25-074512_payment-method-subtype-mandatory/up.sql Unsupported file format
  v2_compatible_migrations/2025-04-02-051959_add_network_error_info_in_payment_attempt/down.sql Unsupported file format
  v2_compatible_migrations/2025-04-02-051959_add_network_error_info_in_payment_attempt/up.sql Unsupported file format
  v2_compatible_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/down.sql Unsupported file format
  v2_compatible_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/up.sql Unsupported file format
  v2_compatible_migrations/2025-04-25-105138_tokenization_service_creation/down.sql Unsupported file format
  v2_compatible_migrations/2025-04-25-105138_tokenization_service_creation/up.sql Unsupported file format
  v2_compatible_migrations/2025-07-16-035805_add_index_on_mca_for_profile_id/down.sql Unsupported file format
  v2_compatible_migrations/2025-07-16-035805_add_index_on_mca_for_profile_id/up.sql Unsupported file format
  v2_migrations/2024-08-28-081837_add_not_null_constraints_to_v2_columns/down.sql Unsupported file format
  v2_migrations/2024-08-28-081837_add_not_null_constraints_to_v2_columns/up.sql Unsupported file format
  v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/down.sql Unsupported file format
  v2_migrations/2024-08-28-081838_update_v2_primary_key_constraints/up.sql Unsupported file format
  v2_migrations/2025-01-13-081847_drop_v1_columns/down.sql Unsupported file format
  v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql Unsupported file format
  v2_migrations/2025-02-10-101458_create_index_payment_attempt_payment_id/down.sql Unsupported file format
  v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/down.sql Unsupported file format
  v2_migrations/2025-05-30-103514_add_connector_request_reference_id_in_payment_attempt/up.sql Unsupported file format

@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Jul 17, 2025
@hrithikesh026 hrithikesh026 linked an issue Jul 28, 2025 that may be closed by this pull request
2 tasks
jarnura
jarnura previously approved these changes Jul 29, 2025
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Other than that, looks good to me!

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 5, 2025
Merged via the queue into main with commit c573f61 Aug 5, 2025
15 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the reorder-migrations branch August 5, 2025 08:25
@hyperswitch-bot hyperswitch-bot bot removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Aug 5, 2025
pixincreate added a commit that referenced this pull request Aug 6, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch: (89 commits)
  feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830)
  feat(core): Add support for Void after Capture (#8839)
  fix(wasm): [FISERV] Added GooglePay Payment Method Type (#8832)
  feat(connector): [Barclaycard] Add Google Pay Payment Method (#8786)
  chore(version): 2025.08.06.0
  feat(core): Added additional authentication fields for 3ds external authentication (#8758)
  refactor(core): propagate network_transaction_id in response of payment (#8829)
  fix(core): add fix for stopping multiple event locking idempotent logs (#8034)
  feat(connector): [AUTHORIZEDOTNET] create connector customer flow added (#8774)
  feat(core): Add L2_L3 Data Support  (#8828)
  feat(connector): [NMI] Add mandates flow (#8652)
  fix(connector): [Wise] send uuid as connector_transaction_id (#8836)
  feat(core): populate UCS status_code in response headers (#8788)
  feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587)
  chore: reorder v2 migrations folders (#8671)
  fix(router): Take merchant ID from headers in API Key - Revoke (v2) (#8808)
  fix(connector): (payload) currency auth key wasm changes (#8825)
  feat(payment-methods): add filtering logic for payment method list v2 (#8606)
  feat(router): add support for apple pay pre-decrypted token in the payments confirm call (#8815)
  chore(version): 2025.08.05.0
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] create accounts schema for accounts tables
4 participants