alter type spending_necessity rename value 'INBETWEEN' to 'BOTH';

alter table buckets add column necessity spending_necessity;
update buckets set necessity = 'BOTH' where necessity is null;
alter table buckets alter column necessity set not null;
alter table buckets alter column necessity set default 'BOTH';

alter table buckets add column window_days integer;
update buckets set window_days = 30 where window_days is null;
alter table buckets alter column window_days set not null;
alter table buckets alter column window_days set default 30;
