github.com/nais/knorten@v0.0.0-20240104110906-55926958e361/pkg/database/migrations/028_remove_ingress_team_values.sql (about) 1 -- +goose Up 2 DELETE FROM chart_team_values WHERE "key" = 'ingress.web.hosts' AND chart_type = 'airflow'; 3 DELETE FROM chart_team_values WHERE "key" IN ('ingress.hosts','ingress.tls') AND chart_type = 'jupyterhub'; 4 5 -- +goose Down 6 INSERT INTO chart_team_values ("key","value","chart_type","team_id") 7 (SELECT DISTINCT ON ("team_id") 'ingress.web.hosts', CONCAT('[{"name":"',left("team_id", -5),'","tls":{"enabled":true,"secretName":"airflow-certificate"}}]'), "chart_type", "team_id" FROM chart_team_values WHERE chart_type = 'airflow'); 8 9 INSERT INTO chart_team_values ("key","value","chart_type","team_id") 10 (SELECT DISTINCT ON ("team_id") 'ingress.hosts', CONCAT('["', left("team_id", -5), '.jupyter.knada.io','"]'), "chart_type", "team_id" FROM chart_team_values WHERE chart_type = 'jupyterhub'); 11 12 INSERT INTO chart_team_values ("key","value","chart_type","team_id") 13 (SELECT DISTINCT ON ("team_id") 'ingress.tls', CONCAT('[{"hosts":["', left("team_id", -5), '.jupyter.knada.io','"], "secretName": "jupyterhub-certificate"}]'), "chart_type", "team_id" FROM chart_team_values WHERE chart_type = 'jupyterhub');