Ho eseguito manualmente un diff sugli schemi di un forum Discourse avviato oltre 5 anni fa e di una nuova installazione; puoi vedere le differenze qui:
https://www.diffchecker.com/lZrp2jxJ
Si tratta principalmente di cambiamenti da bigint a integer e da character varying(255) a character varying, oltre a qualche vincolo not null mancante, ma mancano anche alcuni indici.
Ecco le righe che li evidenziano:
Riga 1646 - mancante:
Index "public.index_badges_on_badge_type_id"
Column | Type | Key? | Definition Column | Type | Key? | Definition
--------+------------------------+------+------------ ---------------+---------+------+---------------
name | character varying(255) | yes | name badge_type_id | integer | yes | badge_type_id
btree, for table "public.badges"
3301 - mancante:
Index "public.index_user_badges_on_user_id"
Column | Type | Key? | Definition
---------+---------+------+------------
user_id | integer | yes | user_id
btree, for table "public.user_badges"
4639 - mancante:
Index "public.schema_migrations_pkey"
Column | Type | Key? | Definition
---------+-------------------+------+------------
version | character varying | yes | version
primary key, btree, for table "public.schema_migrations"
5487 - parzialmente mancante:
Table "public.topic_search_data"
Column | Type | Collation | Nullable | Default Column | Type | Collation | Nullable | Default
-------------+------------------------+-----------+----------+--------- -------------+-------------------+-----------+----------+-----------------------------------------------------
topic_id | integer | | not null | topic_id | integer | | not null | nextval('topic_search_data_topic_id_seq'::regclass)
raw_data | text | | | raw_data | text | | |
locale | character varying(255) | | not null | locale | character varying | | not null |
search_data | tsvector | | | search_data | tsvector | | |
version | integer | | | 0 version | integer | | | 0
5506 - mancante:
Sequence "public.topic_search_data_topic_id_seq"
Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
---------+-------+---------+------------+-----------+---------+-------
integer | 1 | 1 | 2147483647 | 1 | no | 1
Owned by: public.topic_search_data.topic_id
6044 - mancante:
"index_user_badges_on_user_id" btree (user_id)
Dovrei preoccuparmi di qualcosa in particolare? Dovrei aggiungere gli indici manualmente? Qualsiasi altra considerazione o qualcosa che salta all’occhio di qualcun altro? (Sono quasi le 5 del mattino qui e faccio fatica a tenere gli occhi aperti
)