diff --git a/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/down.sql b/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/down.sql new file mode 100644 index 000000000..beb16f583 --- /dev/null +++ b/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/down.sql @@ -0,0 +1,9 @@ +ALTER TABLE "matches" + ADD CONSTRAINT matches_order_id_fkey + FOREIGN KEY (order_id) + REFERENCES orders (order_id); + +ALTER TABLE "matches" + ADD CONSTRAINT matches_match_order_id_fkey + FOREIGN KEY (match_order_id) + REFERENCES orders (order_id); diff --git a/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/up.sql b/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/up.sql new file mode 100644 index 000000000..dc5ad5e1d --- /dev/null +++ b/coordinator/migrations/2024-06-07-105918_drop_foreign_key_constraint_to_order_id_on_matches/up.sql @@ -0,0 +1,2 @@ +ALTER TABLE "matches" DROP CONSTRAINT matches_order_id_fkey; +ALTER TABLE "matches" DROP CONSTRAINT matches_match_order_id_fkey; diff --git a/coordinator/src/schema.rs b/coordinator/src/schema.rs index a0d1ebb95..ac0424001 100644 --- a/coordinator/src/schema.rs +++ b/coordinator/src/schema.rs @@ -216,23 +216,6 @@ diesel::table! { } } -diesel::table! { - use diesel::sql_types::*; - use super::sql_types::InvoiceStateType; - - hodl_invoices (id) { - id -> Int4, - trader_pubkey -> Text, - r_hash -> Text, - amount_sats -> Int8, - pre_image -> Nullable, - created_at -> Timestamptz, - updated_at -> Nullable, - invoice_state -> InvoiceStateType, - order_id -> Nullable, - } -} - diesel::table! { funding_fee_events (id) { id -> Int4, @@ -257,6 +240,23 @@ diesel::table! { } } +diesel::table! { + use diesel::sql_types::*; + use super::sql_types::InvoiceStateType; + + hodl_invoices (id) { + id -> Int4, + trader_pubkey -> Text, + r_hash -> Text, + amount_sats -> Int8, + pre_image -> Nullable, + created_at -> Timestamptz, + updated_at -> Nullable, + invoice_state -> InvoiceStateType, + order_id -> Nullable, + } +} + diesel::table! { last_outbound_dlc_messages (peer_id) { peer_id -> Text,