fixing 12 gauge format
This commit is contained in:
+18
-3
@@ -117,7 +117,7 @@ const pool = databaseUrl
|
||||
password: postgresPassword,
|
||||
});
|
||||
|
||||
const defaultCalibers = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge Sporting', '.45 ACP'];
|
||||
const defaultCalibers = ['9mm', '.22 LR', '5.56 NATO', '.308 Win', '12 Gauge - Birdshot', '12 Gauge - Buckshot', '12 Gauge - Slug', '12 Gauge - Sporting', '.45 ACP'];
|
||||
const firearmCategories = ['Handgun', 'Rifle', 'Shotgun', 'PCC', 'Other'];
|
||||
const sessionHours = 24 * 7;
|
||||
|
||||
@@ -386,7 +386,7 @@ const ensureSchema = async () => {
|
||||
const ensureProfileDefaults = async (profileId: string) => {
|
||||
await pool.query(
|
||||
`UPDATE calibers
|
||||
SET name = '12 Gauge Sporting',
|
||||
SET name = '12 Gauge - Sporting',
|
||||
is_default = TRUE
|
||||
WHERE profile_id = $1
|
||||
AND name = '12 Gauge'
|
||||
@@ -394,7 +394,22 @@ const ensureProfileDefaults = async (profileId: string) => {
|
||||
SELECT 1
|
||||
FROM calibers existing
|
||||
WHERE existing.profile_id = $1
|
||||
AND existing.name = '12 Gauge Sporting'
|
||||
AND existing.name = '12 Gauge - Sporting'
|
||||
)`,
|
||||
[profileId],
|
||||
);
|
||||
|
||||
await pool.query(
|
||||
`UPDATE calibers
|
||||
SET name = '12 Gauge - Sporting',
|
||||
is_default = TRUE
|
||||
WHERE profile_id = $1
|
||||
AND name = '12 Gauge Sporting'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM calibers existing
|
||||
WHERE existing.profile_id = $1
|
||||
AND existing.name = '12 Gauge - Sporting'
|
||||
)`,
|
||||
[profileId],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user