Closed gothub closed 4 years ago
Hi @gothub - I made the subscriptionId
nullable because we use the quotas
table to satisfy two use cases: 1) Provide a list of generic quotas
associated with a given product
, and then 2) associate a specific quota
with a specific subscription
. Since quotas are only created or modified by bookkeeper admin subjects, we can control scenario (2) above in the controller logic. So, unless I'm missing something, I think we need to back out your changes in commit c4e9581. Otherwise our SQL script that populates the standard quotas will fail.
OK, the commit has been reverted in commit fd7628f62e2532c8c66521c733022d43eb4a2524
It's possible to create a quota db entry with a null subscription, if the
subscription
attribute is omitted from the JSON object sent via thePOST /quotas
(QuotasResource.create()) REST endpoint.SInce
quotas.subscriptionId
in the quotas table is a foreign key to thesubscriptions
table, this field should not be null.So,
Quota.java
so that valid quota objects have a subscription id