create table subscriptions (id serial, user_id int, created_at timestamp, end_at timestamp);
insert into subscriptions values (1, 1, '2021-01-01 12:13:14', '2022-01-01 12:13:14');
create view subscriptions_status as select
id, user_id, created_at, end_at,
case when end_at > now() then 1 else 0 end active
from subscriptions;
select * from subscriptions_status;