parent
29541ab425
commit
87f40821dd
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
|
||||
DROP TABLE provinces;
|
||||
CREATE TABLE provinces AS SELECT * FROM provinces_bak_2025_03;
|
||||
DROP TABLE provinces_bak_2025_03;
|
||||
|
||||
-- recreate the claimables table
|
||||
drop table claimables;
|
||||
create table if not exists claimables as
|
||||
with
|
||||
trades as (select distinct trade_node from provinces where trade_node != ''),
|
||||
areas as (select distinct area from provinces where area != ''),
|
||||
regions as (select distinct region from provinces where region != '')
|
||||
select 'trade' as typ, provinces.trade_node as name, name as province, id
|
||||
from provinces inner join trades on trades.trade_node = provinces.trade_node
|
||||
union
|
||||
select 'area' as typ, provinces.area as name, name as province, id
|
||||
from provinces inner join areas on areas.area = provinces.area
|
||||
union
|
||||
select 'region' as typ, provinces.region as name, name as province, id
|
||||
from provinces inner join regions on regions.region = provinces.region
|
||||
;
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue