pivot_forecast/setup_sql/target_info.sql

26 lines
516 B
MySQL
Raw Normal View History

BEGIN;
INSERT INTO
fc.target_meta
SELECT
table_schema
,table_name
,column_name
,ordinal_position
,null::text func
,null::text fkey --foreign key to a master table
,column_name fcol
,data_type::text dtype
,null::text appcol
,null::text pretty
FROM
information_schema.columns
WHERE
table_name = 'dcard_mapped'
2020-10-22 23:08:11 -04:00
AND table_schema = 'fc'
ON CONFLICT ON CONSTRAINT target_meta_pk DO UPDATE SET
opos = EXCLUDED.opos
,dtype = EXCLUDED.dtype;
END;