Add 16 gauge shotgun caliber

This commit is contained in:
Graham McIntire 2026-03-12 09:04:00 -05:00
parent d7c4772ad8
commit 0583bd14cf
No known key found for this signature in database
4 changed files with 20 additions and 0 deletions

View file

@ -22,6 +22,7 @@ defmodule Ammoprices.Scraping.Retailers.LuckyGunner do
"22-wmr" => "/rimfire/22-wmr-ammo",
"17-hmr" => "/rimfire/17-hmr-ammo",
"12-gauge" => "/shotgun/12-gauge-ammo",
"16-gauge" => "/shotgun/16-gauge-ammo",
"20-gauge" => "/shotgun/20-gauge-ammo"
}

View file

@ -22,6 +22,7 @@ defmodule Ammoprices.Scraping.Retailers.SgAmmo do
"22-wmr" => "/catalog/rimfire-ammo-for-sale/22-wmr-ammo",
"17-hmr" => "/catalog/rimfire-ammo-for-sale/17-hmr-ammo",
"12-gauge" => "/catalog/shotgun-ammo-for-sale/12-gauge-ammo",
"16-gauge" => "/catalog/shotgun-ammo-for-sale/16-gauge-ammo",
"20-gauge" => "/catalog/shotgun-ammo-for-sale/20-gauge-ammo"
}

View file

@ -22,6 +22,7 @@ defmodule Ammoprices.Scraping.Retailers.TargetSportsUsa do
"22-wmr" => "/22-wmr-ammo-c-203.aspx",
"17-hmr" => "/17-hmr-ammo-c-198.aspx",
"12-gauge" => "/12-gauge-shotgun-ammo-c-747.aspx",
"16-gauge" => "/16-gauge-shotgun-ammo-c-748.aspx",
"20-gauge" => "/20-gauge-shotgun-ammo-c-749.aspx"
}

View file

@ -0,0 +1,17 @@
defmodule Ammoprices.Repo.Migrations.Add16GaugeCaliber do
use Ecto.Migration
def up do
now = DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_naive()
execute("""
INSERT INTO calibers (id, name, slug, category, aliases, inserted_at, updated_at)
VALUES (gen_random_uuid(), '16 Gauge', '16-gauge', 'shotgun', '{"16 gauge","16 ga","16ga"}', '#{now}', '#{now}')
ON CONFLICT (slug) DO NOTHING
""")
end
def down do
execute("DELETE FROM calibers WHERE slug = '16-gauge'")
end
end