Directus 计算字段/列

Directus calculated field / column

我正在构建一个应用程序,公司需要定期支付订阅费用。这为他们提供了我们网站上的详细列表以及许多其他(现实世界)的好处。当他们的订阅到期时,他们的列表将显示较少的详细信息,直到他们再次付款。

我使用 Directus 作为后端,Vue.js 作为前端。我希望 Vue 前端中的“业务逻辑”尽可能少。

公司的 MySQL table DDL 是

create table company
(
    id               int(11) unsigned auto_increment primary key,
    name             varchar(200) not null comment 'name of company',
    description      text not null,
    address          text null comment 'company physical address'
    web_site         varchar(200) not null,
    ... many other fields
    subscription_expires datetime,
    created_on       datetime null,
    modified_on      datetime null,
)
    charset = utf8mb4;

我想创建多个 MySQL 计算字段:例如,如果 subscription_expires is null or subscription_expires < now() 则为假 company.show_details 字段,如果 modified_on > 24 months agocompany.needs_update 为真=].这将使 Vue 渲染逻辑非常清晰/明显。

我看不到通过 Directus 创建计算字段或通过 mysql 模式同步它们的方法。某处有文档吗?

谢谢!

我认为这仍然是 Directus 的功能请求。也许投票给它更多的牵引力?

https://github.com/directus/directus/discussions/3079