Issue:
Bug: refactor: change primary key of refund table for v2



## Description

Previously our refund table had `id` as PKey. 
Which needs to be changed to a composite Primary key as `(merchant_id, refund_id)`.

Pull request description:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Previously our Refund table had id as PKey.
Which needs to be changed to a composite Primary key as (merchant_id, refund_id).

### Additional Changes

- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested it by compiling the code and checking the file `query/refund.rs`, where id is nowhere being used.


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Testing:

Tested it by compiling the code and checking the file `query/refund.rs`, where id is nowhere being used.

Patch:
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index 171e1cfe2e3..4b5f4a8ad49 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -1099,7 +1099,7 @@ diesel::table! {
     use diesel::sql_types::*;
     use crate::enums::diesel_exports::*;
 
-    refund (id) {
+    refund (merchant_id, refund_id) {
         id -> Int4,
         #[max_length = 64]
         internal_reference_id -> Varchar,
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index d16ddcd6518..a2e35a6d6a9 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -1097,7 +1097,7 @@ diesel::table! {
     use diesel::sql_types::*;
     use crate::enums::diesel_exports::*;
 
-    refund (id) {
+    refund (merchant_id, refund_id) {
         id -> Int4,
         #[max_length = 64]
         internal_reference_id -> Varchar,
diff --git a/migrations/2024-07-19-044034_change_primary_key_for_refund/down.sql b/migrations/2024-07-19-044034_change_primary_key_for_refund/down.sql
new file mode 100644
index 00000000000..42faa31536f
--- /dev/null
+++ b/migrations/2024-07-19-044034_change_primary_key_for_refund/down.sql
@@ -0,0 +1,5 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE refund DROP CONSTRAINT refund_pkey;
+
+ALTER TABLE refund
+ADD PRIMARY KEY (id);
diff --git a/migrations/2024-07-19-044034_change_primary_key_for_refund/up.sql b/migrations/2024-07-19-044034_change_primary_key_for_refund/up.sql
new file mode 100644
index 00000000000..bbd6ef735da
--- /dev/null
+++ b/migrations/2024-07-19-044034_change_primary_key_for_refund/up.sql
@@ -0,0 +1,12 @@
+-- Your SQL goes here
+-- The below query will lock the refund table
+-- Running this query is not necessary on higher environments
+-- as the application will work fine without these queries being run
+-- This query should be run after the new version of application is deployed
+ALTER TABLE refund DROP CONSTRAINT refund_pkey;
+
+-- Use the `merchant_id, refund_id` columns as primary key
+-- These are already unique, not null columns
+-- So this query should not fail for not null or duplicate value reasons
+ALTER TABLE refund
+ADD PRIMARY KEY (merchant_id, refund_id);