たとえば、いくつかのテーブルがあります。
news:
id | title | description
1 | This is first title of news | This is description
2 | This is second title of news | This is second description
blog:
id | title | description
1 | This is first title of blog | This is description
2 | This is second title of blog | This is second description
さらに10を超えるテーブル。
0 または 1 の 2 つの値を持つことができる「some_state」フィールドを 1 つ追加する必要があります。
だから私は2つの方法で行くことができます:
1) このフィールドを各テーブルに追加します。
2) 新しいテーブルを作成します。例:
tables_some_state:
id | table_name | table_id | some_state
1 | news | 1 | 0
2 | news | 2 |1
3 | blog | 1 | 1
4 | blog | 2 | 1
...
このテーブルをクエリの各テーブルに左結合します。
では、私の場合のベストプラクティスは何ですか?