ai-cfia / ai-cfia/ailab-datastore

As a dev, I want to simplify the usage of `sub_type` in `fertiscan`

未关闭
#163 5 条评论 0 个 reaction 已指派 1 人 已被 @Francois-Werbrouck 认领 在 GitHub 查看
主要语言
Python
星标
3
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

## Description

**Context**
Currently, the `sub_type` table is defined with fields `type_fr` and `type_en` as unique text columns. However, we never actually use `type_fr` in practice. The `sub_type` is being used more like an enum. After schema creation, we have to perform separate `sub_type` inserts to populate this table, which is necessary for the database design to be usable.

![Image](https://github.com/user-attachments/assets/2d05d1e3-9b69-46ce-8ead-f3b35b9f3b02)

**Problem Statement**
The need to perform separate `sub_type` inserts after schema creation adds unnecessary complexity to our setup and deployment processes. This approach has several drawbacks:

- **Increased Setup Complexity**: Additional scripts or manual steps are required to insert initial data, which can be error-prone.
- **Deployment Challenges**: Ensuring that the inserts run in the correct order and environment adds overhead.
- **Maintenance Overhead**: Keeping track of initial data inserts complicates version control and collaboration.

By using an enum instead of a table for `sub_type`, we can simplify the schema and eliminate the need for post-creation data inserts.

## Acceptance Criteria
- Evaluate the feasibility and benefits of replacing the `sub_type` table with an enum.
- Implement the enum to replace the `sub_type` table if it leads to simplification.
- Remove the need for separate `sub_type` inserts after schema creation.
- Ensure that existing functionality dependent on `sub_type` remains unaffected.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。