beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
47 stars 47 forks source link

Add indexes for foreign key constraints #286

Closed geekingfrog closed 2 months ago

geekingfrog commented 2 months ago

Related to the discussion on discord. Once merged, the migration will be applied on the next server startup.

This can also be applied manually before:

mix ecto.migrations # display migrations status
mix ecto.migrate --log-migrations-sql # apply pending migrations and print the SQL used
mix ecto.rollback # rollback the last applied migration

The indexes are coming from \d+ teiserver_battle_matches and creating any index in the Referenced by section that don't already exist.

Beherith commented 2 months ago

Thank you, made this job literally 1000x faster!