liquibase.changelogs.v3_10_0.schema-add-default-scopes.yml Maven / Gradle / Ivy
databaseChangeLog:
- changeSet:
id: 3.10.0-add-default-scopes
author: GraviteeSource Team
changes:
- sql:
dbms: postgresql
sql: "UPDATE applications SET settings = jsonb_set(cast(settings as jsonb), '{oauth,defaultScopes}', settings->'oauth'->'scopes', true) where (settings->'oauth'->'scopes') IS NOT NULL;"
- sql:
dbms: mysql, mariadb
sql: "UPDATE applications SET settings = JSON_SET(settings, '$.oauth.defaultScopes', JSON_EXTRACT(settings,'$.oauth.scopes')) where JSON_EXTRACT(settings,'$.oauth.scopes') IS NOT NULL;"
- sql:
dbms: mssql
sql: "UPDATE applications SET settings = JSON_MODIFY(settings, '$.oauth.defaultScopes', JSON_QUERY(settings, '$.oauth.scopes')) where JSON_QUERY(settings, '$.oauth.scopes') IS NOT NULL;"