mediacloud / web-search

Code that drives the public web-based tools for the Media Cloud Online News Archive and Directory.
https://search.mediacloud.org
Apache License 2.0
10 stars 15 forks source link

Make default quota(s) adjustable? #858

Open philbudne opened 3 days ago

philbudne commented 3 days ago

We recently decided 4000 is a reasonable default value for the onlinenews-mediacloud quota, but there's no easy way to adjust it; I've just done an SQL UPDATE each day since then.

It would be lovely if the default quota was stored as a "property" (in a default-quotas section) named by the provider, and if the user-quota has some distinctive value (0?? -1??? NUL????), the default value is used instead...

I guess the quota_XXX columns in the users_profile table could be viewed as "denormalized", and it could be represented as a users_quota table keyed by user_id and provider, and the table could only contain the exceptions (any non-staff user without a table entry gets the default).... But not sure it's worth the effort to do a migration!

philbudne commented 3 days ago

The SQL command, and today's output:

mcweb_db=# update users_profile set quota_mediacloud = 4000 where quota_mediacloud = 100000;
UPDATE 15