Remove Tags from Auth App?
- Dominant language
- Elixir
- Stars
- 141
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
# Context
We have two types of [**`metadata`**](https://en.wikipedia.org/wiki/Metadata) that can be added to records in order to help categorise the data; **`tags`** and **`status`**.
Our reasoning for having these two types of metadata is simple: one is "system" and can only be applied by the application/admin, while the other is "user" and can be applied person using the app. This makes perfect sense in the
A record (e.g. [`person`](https://github.com/dwyl/auth/issues/45) or [`app`](#95)) can (_only_) have ***one*** **`status`** at a time e.g. **`verified`** or **`active`** respectively.
An **`item`** record can have _multiple_ **`tags`**; I still think it makes _perfect_ sense for `items` in the **`@dwyl` App** to use **`tags`** for categorisation, see: https://github.com/dwyl/app/issues/245
The _reason_ we have `tags` in the **`auth`** app is because we imported the schema from the [`app-mvp`](https://github.com/dwyl/app-mvp-phoenix)
# Not Using `tags`
At present we are not using **`tags`** in the **`auth`** app.
```sql
dwylauth::DATABASE=> SELECT * FROM tags;
id | text | inserted_at | updated_at | person_id
----+------+-------------+------------+-----------
(0 rows)
```
Correspondingly, none of the `people` records have a `tag` applied:
```sql
dwylauth::DATABASE=> select id, status, tag, inserted_at from people ORDER by id DESC;
id | status | tag | inserted_at
---------+--------+-----+---------------------
9089056 | 1 | | 2020-06-30 13:29:01
6057298 | 1 | | 2020-05-04 14:49:59
13 | | | 2020-08-04 09:43:49
12 | 1 | | 2020-07-01 17:24:31
11 | 1 | | 2020-07-01 08:28:42
10 | | | 2020-05-14 16:41:40
9 | | | 2020-05-12 16:20:32
8 | 1 | | 2020-05-12 13:36:49
7 | 1 | | 2020-05-12 06:01:24
6 | | | 2020-05-11 16:06:18
5 | 1 | | 2020-05-11 16:03:21
3 | 1 | | 2020-04-24 13:33:52
2 | 1 | | 2020-04-22 17:18:07
1 | 1 | | 2020-04-22 17:13:28
(14 rows)
```
# Todo
+ [ ] Remove **`tags`** from create_people migration: [`20191113100920_create_people.exs#L15`](https://github.com/dwyl/auth/blob/fafc5e059d65de420b4d99bf1d15ac45a3bcda12/priv/repo/migrations/20191113100920_create_people.exs#L15)
+ [ ] Delete the original migration file: [`priv/repo/migrations/20191113100513_create_tags.exs`](https://github.com/dwyl/auth/blob/fafc5e059d65de420b4d99bf1d15ac45a3bcda12/priv/repo/migrations/20191113100513_create_tags.exs)
+ [ ] **`DELETE`** any other migration files that relate to `tags`, e.g: [`20191113114340_add_person_id_to_tag.exs`](https://github.com/dwyl/auth/blob/fafc5e059d65de420b4d99bf1d15ac45a3bcda12/priv/repo/migrations/20191113114340_add_person_id_to_tag.exs)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.