Skip to content

Commit

Permalink
chore: add activites fta -> rst migration
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed Jan 20, 2025
1 parent b7bfac1 commit db5828d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions migrations/fta/sql/V1.0.2__fta_to_rst.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@ insert into rst.recreation_resource (rec_resource_id, name, description, site_lo
select
rp.forest_file_id,
rp.project_name as name,
rc.project_comment as description,
case
when rc.rec_comment_type_code = 'DESC' then rc.project_comment
else ''
end as description,
rp.site_location
from
fta.recreation_project rp
left join
fta.recreation_comment rc
on
rp.forest_file_id = rc.forest_file_id
where
rc.rec_comment_type_code = 'DESC';
on conflict do nothing;

insert into rst.recreation_activity_code (recreation_activity_code, description)
select
rac.recreation_activity_code,
rac.description as description
from
fta.recreation_activity_code rac;


insert into rst.recreation_activity (rec_resource_id, recreation_activity_code)
select
ra.forest_file_id as rec_resource_id,
ra.recreation_activity_code
from
fta.recreation_activity ra;

0 comments on commit db5828d

Please sign in to comment.