1.通用方法:
eg:
do $$ begin begin alter table dingtalk_corp_info add column admin_id text; exception when duplicate_column then raise notice 'column admin_id already exists in dingtalk_corp_info.'; end; end; $$;
2.pgsql 9.6+:
eg:
alter table dingtalk_corp_info add column if not exists admin_id text;
3.直接添加
eg:
alter table dingtalk_corp_info add column admin_id text;