diff --git a/resources/queries/targetedms/InstrumentBilling.sql b/resources/queries/targetedms/InstrumentBilling.sql
index d9cb727f5..fba7ba8ee 100644
--- a/resources/queries/targetedms/InstrumentBilling.sql
+++ b/resources/queries/targetedms/InstrumentBilling.sql
@@ -32,5 +32,5 @@ SELECT
((TIMESTAMPDIFF('SQL_TSI_HOUR', StartTime, EndTime) * Fee + ir.rateType.setupFee) * PercentPayment / 100) AS AmountBilled
FROM targetedms.InstrumentSchedule i
-INNER JOIN targetedms.InstrumentRate ir ON i.Instrument = ir.Instrument
-INNER JOIN targetedms.InstrumentUsagePayment iup ON i.Id = iup.InstrumentScheduleId
\ No newline at end of file
+INNER JOIN targetedms.InstrumentUsagePayment iup ON i.Id = iup.InstrumentScheduleId
+INNER JOIN targetedms.InstrumentRate ir ON i.Instrument = ir.Instrument AND iup.PaymentMethod.RateType = ir.rateType
\ No newline at end of file
diff --git a/resources/schemas/dbscripts/postgresql/targetedms-26.000-26.001.sql b/resources/schemas/dbscripts/postgresql/targetedms-26.000-26.001.sql
new file mode 100644
index 000000000..307cb822b
--- /dev/null
+++ b/resources/schemas/dbscripts/postgresql/targetedms-26.000-26.001.sql
@@ -0,0 +1,33 @@
+-- Add FKs to Containers and delete orphaned rows
+DELETE FROM targetedms.instrumentUsagePayment WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.instrumentSchedule WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.projectPaymentMethod WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.projectResearcher WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.msProject WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.instrumentRate WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.msInstrument WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.paymentMethod WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+DELETE FROM targetedms.rateType WHERE Container NOT IN (SELECT EntityId FROM core.Containers);
+
+ALTER TABLE targetedms.instrumentUsagePayment ADD CONSTRAINT FK_InstrumentUsagePayment_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.msProject ADD CONSTRAINT FK_MSProject_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.projectResearcher ADD CONSTRAINT FK_ProjectResearcher_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.instrumentRate ADD CONSTRAINT FK_InstrumentRate_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.msInstrument ADD CONSTRAINT FK_MSInstrument_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.paymentMethod ADD CONSTRAINT FK_PaymentMethod_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.projectPaymentMethod ADD CONSTRAINT FK_ProjectPaymentMethod_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.instrumentSchedule ADD CONSTRAINT FK_InstrumentSchedule_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+ALTER TABLE targetedms.rateType ADD CONSTRAINT FK_RateType_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId);
+
+-- Add a RateType column to paymentMethod, set its values (creating one if needed), and make it not null
+ALTER TABLE targetedms.paymentMethod ADD COLUMN RateType INT;
+ALTER TABLE targetedms.paymentMethod ADD CONSTRAINT FK_PaymentMethod_RateType FOREIGN KEY (RateType) REFERENCES targetedms.RateType(Id);
+
+UPDATE targetedms.paymentMethod pm SET RateType = (SELECT MIN(Id) FROM targetedms.RateType rt WHERE rt.Container = pm.Container);
+
+INSERT INTO targetedms.RateType (Name, Container)
+ SELECT DISTINCT 'Default', Container FROM targetedms.paymentMethod WHERE RateType IS NULL;
+
+UPDATE targetedms.paymentMethod pm SET RateType = (SELECT MIN(Id) FROM targetedms.RateType rt WHERE rt.Container = pm.Container) WHERE RateType IS NULL;
+
+ALTER TABLE targetedms.paymentMethod ALTER COLUMN RateType SET NOT NULL;
\ No newline at end of file
diff --git a/resources/schemas/targetedms.xml b/resources/schemas/targetedms.xml
index ab3cba8e1..2bd32a2d8 100644
--- a/resources/schemas/targetedms.xml
+++ b/resources/schemas/targetedms.xml
@@ -1823,6 +1823,7 @@