discourse/plugins/chat/db
Andrei Prigorshnev e83d8fb3e2
FIX: Allow several chat channels to have an empty slug (#25680)
In certain cases, chat channels may have empty slugs, it happens when:

1. The `slug_generation_method` setting is set to `None`
2. `slug_generation_method` is set to `ASCII` and a channel with 
a Unicode name and an empty slug is created (in this case, the code 
that creates channels tries to generate a slug and fallbacks to an empty slug)

At the moment, we have a unique index on the `chat_channels.slug` column 
which leads to errors when creating several channels with empty slugs 
(Discourse is able to create one such channel, but when trying to create 
the second one fails because of the unique constraint). This PR fixes that 
by adding a `where` condition to the index. Slugs still have to be unique, 
but now many channels may have empty slugs.

This fix is similar to the one we made to the category slugs – 7ba914f1e1.
2024-02-15 00:39:39 +04:00
..
fixtures DEV: properly namespace chat (#20690) 2023-03-17 14:24:38 +01:00
migrate FIX: Allow several chat channels to have an empty slug (#25680) 2024-02-15 00:39:39 +04:00
post_migrate DEV: Promote historic post_deploy migrations (#25334) 2024-01-19 14:47:42 +00:00