Let visitors tick providers (Yandex, IXcellerate, RTK-DC, Sber, …) and get the usual 5×5 card made of only those providers' datacenters, first 25 in ranking order, with lines scored as normal. A selection with fewer than 25 sites leaves the rest of the card empty, so the card is always 5×5. Each provider chip shows crossed/total for the current view. Datacenters get a provider slug, backfilled from the free-text operator, guessed for new rows and editable in the admin. Filtered URLs are noindex with canonical to the plain card. Assisted-by: Claude:opus-5
23 lines
1.1 KiB
Ruby
23 lines
1.1 KiB
Ruby
Sequel.migration do
|
||
up do
|
||
# Company grouping for the per-provider cards (Bingo::PROVIDERS slugs).
|
||
# Backfilled from the free-text operator; Datacenter#before_create keeps
|
||
# new rows filled the same way (Bingo.guess_provider).
|
||
add_column :bingo_datacenters, :provider, String
|
||
{
|
||
'yandex' => %w[Яндекс%], 'ixcellerate' => %w[IXcellerate%], 'rtk' => %w[РТК-ЦОД%],
|
||
'atomdata' => %w[Атомдата% Росатом%], 'datapro' => %w[DataPro%], 'selectel' => %w[Selectel%],
|
||
'mws' => %w[MWS% МТС%], 'keypoint' => ['Key Point%'], '3data' => %w[3data%], 'sber' => %w[Сбер%],
|
||
'megafon' => %w[МегаФон%], 'datahouse' => %w[DataHouse%], 'oxygen' => %w[OXYGEN%], 'linx' => %w[Linx%],
|
||
'cloudx' => ['Cloud X%'], 'nkgroup' => ['NK Group%'], 'goznak' => %w[Гознак%]
|
||
}.each do |slug, patterns|
|
||
patterns.each do |pat|
|
||
self[:bingo_datacenters].where(provider: nil).where(Sequel.ilike(:operator, pat)).update(provider: slug)
|
||
end
|
||
end
|
||
end
|
||
|
||
down do
|
||
drop_column :bingo_datacenters, :provider
|
||
end
|
||
end
|