add_default_envs.sql 459 B

1234567891011121314
  1. with ecc as (
  2. insert into environment_configs (
  3. "created_at",
  4. "updated_at",
  5. "project_id",
  6. "cluster_id",
  7. "name",
  8. "auto",
  9. "is_default"
  10. ) select now(), now(), p.id as project_id, c.id as cluster_id, c."name", false, true from projects p join clusters c on c.project_id = p.id where p.simplified_view_enabled = true
  11. returning id, cluster_id
  12. ) update porter_apps pa set environment_config_id = ecc.id
  13. from ecc
  14. where pa.cluster_id = ecc.cluster_id