hi folks, i was trying to understand what does `kr...
# talk-kratos
b
hi folks, i was trying to understand what does
kratos migrate sql
do exactly? https://www.ory.sh/docs/kratos/cli/kratos-migrate-sql the doc says "Create SQL schemas and apply migration plans" so let's say we are upgrading kratos, which is already connected with a db. 1. in this upgrade scenario, is it going to create a new SQL schema in the existing db, what schema it's going to create? 2. what migration plans it's going to apply here? it seems the migration plan is auto-generated by Kratos and user doesn't need to supply the migration plan sorry if the answer is too obvious, appreciate any help. thanks in advance!
s
the schema is what you set-up in the DSN URL
but that will be hard to review, so I recommend to just run that on an empty test db and see the resulting tables
b
thanks! i will see what's in there. i also see folks define the following in
extraInitContainers
in a helm values file:
Copy code
deployment:      
      extraInitContainers:
        - name: kratos-automigrate
          image: "oryd/kratos:v0.9.0-alpha.3"
          imagePullPolicy: IfNotPresent
          command: ["kratos"]
          args:
            [
              "migrate",
              "sql",
              "-e",
              "--yes",
              "--config",
              "/etc/config/kratos.yaml",
            ]
          volumeMounts:
            - name: kratos-config-volume
              mountPath: /etc/config
              readOnly: true
      ...
if i set
autoMigrate
as
true
do i still need this part? i suppose this specific config and
autoMigrate
will do the same things - creating sql schemas, but here it passes in
--config kratos.yaml
, if i enable
autoMigrate
, it will automatically pick up
kratos.config
defined in the helm values file right?
s
there was recently some change, have a look in #self-hosted
👀 1
b
thanks i will ask there