pivot_forecast/setup_sql/target_info.sql

26 lines
511 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
2022-04-09 02:29:51 -04:00
table_name = 'dcard'
AND table_schema = 'tpsv'
ON CONFLICT ON CONSTRAINT target_meta_pk DO UPDATE SET
opos = EXCLUDED.opos
,dtype = EXCLUDED.dtype;
END;