apiVersion: v1
kind: Pod
metadata:
  name: db-upgrade-job
spec:
  restartPolicy: Never
  containers:
    - name: migration-upgrade
      image: gcr.io/$PROJECT_ID/aqueduct-heroes:latest
      envFrom:
        - secretRef:
            name: secrets
        - configMapRef:
            name: config
      command: ["pub"]
      args: ["run", "aqueduct:aqueduct", "db", "upgrade", "--connect", "postgresql://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@db-service:5432/$(POSTGRES_DB)"]
