diff --git a/app/src/db/migrations/20241120000000_012-permit-name-updates.ts b/app/src/db/migrations/20241120000000_012-permit-name-updates.ts index 9aa8ad77..ecbffe83 100644 --- a/app/src/db/migrations/20241120000000_012-permit-name-updates.ts +++ b/app/src/db/migrations/20241120000000_012-permit-name-updates.ts @@ -25,6 +25,15 @@ export async function up(knex: Knex): Promise { end`) ) + .then(() => + knex.schema.raw(`update public.permit_type + set agency = case + when agency = 'Environment and Climate Change Strategy' then 'Environment and Parks' + when agency = 'Transportation and Infrastructure' then 'Transportation and Transit' + else agency + end`) + ) + .then(() => { return knex('permit_type').insert([ { @@ -88,6 +97,15 @@ export async function down(knex: Knex): Promise { WHERE name = 'Fish & Wildlife Fish Salvage Permit'`) ) + .then(() => + knex.schema.raw(`update public.permit_type + set agency = case + when agency = 'Environment and Parks' then 'Environment and Climate Change Strategy' + when agency = 'Transportation and Transit' then 'Transportation and Infrastructure' + else agency + end`) + ) + .then(() => knex.schema.raw(`update public.permit_type set name = case