apiVersion: batch/v1
kind: Job
metadata:
  name: migrations
spec:
  template:
    spec:
      containers:
      - name: migrations
        image: migrations
        command: ["migrate"]
        args: ["-path", "/migrations", "-database", "$(LLINK_POSTGRES_CONNECTION_URL)", "up"]
        env:
        - name: "LLINK_POSTGRES_CONNECTION_URL"
          valueFrom:
            secretKeyRef:
              name: shared-secrets
              key: LLINK_POSTGRES_CONNECTION_URL
      restartPolicy: Never
  backoffLimit: 0
