> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/database-devops/database-schema.md).

# Database Schema

This contains APIs for performing CRUD operations on Database Schema Entity

## List database schemas

> List database Schemas

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema":{"get":{"description":"List database Schemas","operationId":"V1ListProjDbSchema","parameters":[{"$ref":"#/components/parameters/PageIndex"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/SearchTerm"},{"$ref":"#/components/parameters/Sort"},{"$ref":"#/components/parameters/Order"},{"$ref":"#/components/parameters/MigrationTypeParam"}],"responses":{"200":{"$ref":"#/components/responses/DBSchemaListResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"List database schemas","tags":["Database Schema"]}}},"components":{"parameters":{"PageIndex":{"description":"Pagination page number strategy: Specify the page number within the paginated collection related to the number of items on each page.","in":"query","name":"page","schema":{"default":0,"format":"int64","type":"integer"}},"Limit":{"description":"Pagination: Number of items to return.","in":"query","name":"limit","schema":{"default":10,"maximum":100,"type":"integer"}},"SearchTerm":{"allowEmptyValue":true,"description":"This would be used to filter resources having attributes matching the search term.","in":"query","name":"search_term","schema":{"type":"string"}},"Sort":{"description":"Parameter on the basis of which sorting is done.","in":"query","name":"sort","schema":{"default":"created","enum":["name","updated","created"],"type":"string"}},"Order":{"description":"Order on the basis of which sorting is done.","in":"query","name":"order","schema":{"default":"DESC","enum":["ASC","DESC"],"type":"string"}},"MigrationTypeParam":{"description":"DB Migration tool type","in":"query","name":"migrationType","schema":{"enum":["Liquibase","Flyway"],"type":"string"}}},"responses":{"DBSchemaListResponse":{"content":{"application/json":{"schema":{"description":"Response body for List Schema","items":{"$ref":"#/components/schemas/DBSchemaOut"},"type":"array"}}},"description":"Response body for List Database Schema","headers":{"X-Page-Number":{"description":"Page number in Paginated response.","schema":{"type":"integer"}},"X-Page-Size":{"description":"Maximum page size in Paginated response.","schema":{"type":"integer"}},"X-Total-Elements":{"description":"Total number of elements returned in Paginated response.","schema":{"type":"integer"}}}},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}},"schemas":{"DBSchemaOut":{"description":"Database Schema Response","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"created":{"description":"epoch seconds when the database schema was created","format":"int64","type":"integer"},"identifier":{"description":"identifier of the database schema","type":"string"},"instanceCount":{"description":"number of database instances corresponding to database schema","format":"int64","type":"integer"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"parentId":{"description":"parentUniqueId for scope schema belongs to","type":"string"},"primaryDbInstanceId":{"description":"Identifier for the primary dbInstance used for advanced feature like LLM Authoring etc.","type":"string"},"schemaSourceType":{"enum":["Git","Artifactory","Custom","HarnessCode"],"readOnly":true,"type":"string"},"service":{"description":"harness service corresponding to database schema","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"updated":{"description":"epoch seconds when the database schema was last updated","format":"int64","type":"integer"},"usePercona":{"default":false,"description":"if percona-toolkit is enabled","type":"boolean"}},"required":["identifier","name","created","instanceCount","type","parentId","migrationType","usePercona"],"title":"Database Schema Response","type":"object"},"ChangeLogScript":{"additionalProperties":false,"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","minLength":1,"type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","minLength":1,"type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["image","command","shell","location"],"title":"changeLog script","type":"object"},"Changelog":{"additionalProperties":false,"description":"if schemaType is Repository location of the changelog file containing schema changes in a git repository.\nProvide connector for third-party git connectors, or repo without connector to use Harness Code Repository.\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","minLength":1,"type":"string"},"connector":{"description":"identifier of the harness git connector. Optional when using Harness Code Repository. Omit or set to empty string to use Harness Code Repository (requires `repo` to be set).\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","minLength":1,"type":"string"},"location":{"description":"path to the change log file","minLength":1,"type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","minLength":1,"type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["location"],"type":"object"},"CloneResources":{"additionalProperties":false,"description":"Optional CPU/memory limits applied to DBOPS clone sub-steps\n(Git clone, Artifactory download, or custom Script run).\nWhen unset, pipeline step resources are used.\n","properties":{"limits":{"$ref":"#/components/schemas/ContainerResourceLimits"}},"type":"object"},"ContainerResourceLimits":{"additionalProperties":false,"description":"CPU and memory quantity limits for clone containers.\nCPU accepts cores (e.g. \"0.5\", \"1\") or millicores (e.g. \"400m\").\nMemory accepts Mi, Gi, M, G suffixes (e.g. \"500Mi\", \".5Gi\", \"1G\") or a unitless number.\n","properties":{"cpu":{"description":"CPU limit (e.g. 400m, 0.5, 1)","minLength":1,"type":"string"},"memory":{"description":"Memory limit (e.g. 500Mi, .5Gi, 1G)","minLength":1,"type":"string"}},"type":"object"},"MigrationType":{"default":"Liquibase","description":"DB Migration tool type","enum":["Liquibase","Flyway"],"title":"MigrationType","type":"string"},"DBSchemaType":{"description":"db schema type","enum":["Repository","Script"],"title":"DBSchemaType","type":"string"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}}}}
```

## Create a database schema

> Create a database schema

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema":{"post":{"description":"Create a database schema","operationId":"V1CreateProjDbSchema","requestBody":{"$ref":"#/components/requestBodies/DBSchemaCreateRequest"},"responses":{"201":{"$ref":"#/components/responses/DBSchemaResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"Create a database schema","tags":["Database Schema"]}}},"components":{"requestBodies":{"DBSchemaCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSchemaIn"}}},"required":true}},"schemas":{"DBSchemaIn":{"description":"Database Schema Request ","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"identifier":{"description":"identifier of the database schema","pattern":"^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$","type":"string"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"service":{"description":"harness service corresponding to database schema\n","minLength":1,"type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","maxProperties":128,"type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"usePercona":{"default":false,"description":"if percona-toolkit to be enabled","type":"boolean"}},"required":["identifier","name"],"title":"Database Schema Request","type":"object"},"ChangeLogScript":{"additionalProperties":false,"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","minLength":1,"type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","minLength":1,"type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["image","command","shell","location"],"title":"changeLog script","type":"object"},"Changelog":{"additionalProperties":false,"description":"if schemaType is Repository location of the changelog file containing schema changes in a git repository.\nProvide connector for third-party git connectors, or repo without connector to use Harness Code Repository.\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","minLength":1,"type":"string"},"connector":{"description":"identifier of the harness git connector. Optional when using Harness Code Repository. Omit or set to empty string to use Harness Code Repository (requires `repo` to be set).\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","minLength":1,"type":"string"},"location":{"description":"path to the change log file","minLength":1,"type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","minLength":1,"type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["location"],"type":"object"},"CloneResources":{"additionalProperties":false,"description":"Optional CPU/memory limits applied to DBOPS clone sub-steps\n(Git clone, Artifactory download, or custom Script run).\nWhen unset, pipeline step resources are used.\n","properties":{"limits":{"$ref":"#/components/schemas/ContainerResourceLimits"}},"type":"object"},"ContainerResourceLimits":{"additionalProperties":false,"description":"CPU and memory quantity limits for clone containers.\nCPU accepts cores (e.g. \"0.5\", \"1\") or millicores (e.g. \"400m\").\nMemory accepts Mi, Gi, M, G suffixes (e.g. \"500Mi\", \".5Gi\", \"1G\") or a unitless number.\n","properties":{"cpu":{"description":"CPU limit (e.g. 400m, 0.5, 1)","minLength":1,"type":"string"},"memory":{"description":"Memory limit (e.g. 500Mi, .5Gi, 1G)","minLength":1,"type":"string"}},"type":"object"},"MigrationType":{"default":"Liquibase","description":"DB Migration tool type","enum":["Liquibase","Flyway"],"title":"MigrationType","type":"string"},"DBSchemaType":{"description":"db schema type","enum":["Repository","Script"],"title":"DBSchemaType","type":"string"},"DBSchemaOut":{"description":"Database Schema Response","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"created":{"description":"epoch seconds when the database schema was created","format":"int64","type":"integer"},"identifier":{"description":"identifier of the database schema","type":"string"},"instanceCount":{"description":"number of database instances corresponding to database schema","format":"int64","type":"integer"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"parentId":{"description":"parentUniqueId for scope schema belongs to","type":"string"},"primaryDbInstanceId":{"description":"Identifier for the primary dbInstance used for advanced feature like LLM Authoring etc.","type":"string"},"schemaSourceType":{"enum":["Git","Artifactory","Custom","HarnessCode"],"readOnly":true,"type":"string"},"service":{"description":"harness service corresponding to database schema","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"updated":{"description":"epoch seconds when the database schema was last updated","format":"int64","type":"integer"},"usePercona":{"default":false,"description":"if percona-toolkit is enabled","type":"boolean"}},"required":["identifier","name","created","instanceCount","type","parentId","migrationType","usePercona"],"title":"Database Schema Response","type":"object"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}},"responses":{"DBSchemaResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSchemaOut"}}},"description":"Response body for Database Schema"},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}}}}
```

## Get a database schema

> Retrieves the specified database schema

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}":{"get":{"description":"Retrieves the specified database schema","operationId":"V1GetProjDbSchema","responses":{"200":{"$ref":"#/components/responses/DBSchemaResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"Get a database schema","tags":["Database Schema"]}}},"components":{"responses":{"DBSchemaResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSchemaOut"}}},"description":"Response body for Database Schema"},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}},"schemas":{"DBSchemaOut":{"description":"Database Schema Response","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"created":{"description":"epoch seconds when the database schema was created","format":"int64","type":"integer"},"identifier":{"description":"identifier of the database schema","type":"string"},"instanceCount":{"description":"number of database instances corresponding to database schema","format":"int64","type":"integer"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"parentId":{"description":"parentUniqueId for scope schema belongs to","type":"string"},"primaryDbInstanceId":{"description":"Identifier for the primary dbInstance used for advanced feature like LLM Authoring etc.","type":"string"},"schemaSourceType":{"enum":["Git","Artifactory","Custom","HarnessCode"],"readOnly":true,"type":"string"},"service":{"description":"harness service corresponding to database schema","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"updated":{"description":"epoch seconds when the database schema was last updated","format":"int64","type":"integer"},"usePercona":{"default":false,"description":"if percona-toolkit is enabled","type":"boolean"}},"required":["identifier","name","created","instanceCount","type","parentId","migrationType","usePercona"],"title":"Database Schema Response","type":"object"},"ChangeLogScript":{"additionalProperties":false,"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","minLength":1,"type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","minLength":1,"type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["image","command","shell","location"],"title":"changeLog script","type":"object"},"Changelog":{"additionalProperties":false,"description":"if schemaType is Repository location of the changelog file containing schema changes in a git repository.\nProvide connector for third-party git connectors, or repo without connector to use Harness Code Repository.\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","minLength":1,"type":"string"},"connector":{"description":"identifier of the harness git connector. Optional when using Harness Code Repository. Omit or set to empty string to use Harness Code Repository (requires `repo` to be set).\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","minLength":1,"type":"string"},"location":{"description":"path to the change log file","minLength":1,"type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","minLength":1,"type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["location"],"type":"object"},"CloneResources":{"additionalProperties":false,"description":"Optional CPU/memory limits applied to DBOPS clone sub-steps\n(Git clone, Artifactory download, or custom Script run).\nWhen unset, pipeline step resources are used.\n","properties":{"limits":{"$ref":"#/components/schemas/ContainerResourceLimits"}},"type":"object"},"ContainerResourceLimits":{"additionalProperties":false,"description":"CPU and memory quantity limits for clone containers.\nCPU accepts cores (e.g. \"0.5\", \"1\") or millicores (e.g. \"400m\").\nMemory accepts Mi, Gi, M, G suffixes (e.g. \"500Mi\", \".5Gi\", \"1G\") or a unitless number.\n","properties":{"cpu":{"description":"CPU limit (e.g. 400m, 0.5, 1)","minLength":1,"type":"string"},"memory":{"description":"Memory limit (e.g. 500Mi, .5Gi, 1G)","minLength":1,"type":"string"}},"type":"object"},"MigrationType":{"default":"Liquibase","description":"DB Migration tool type","enum":["Liquibase","Flyway"],"title":"MigrationType","type":"string"},"DBSchemaType":{"description":"db schema type","enum":["Repository","Script"],"title":"DBSchemaType","type":"string"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}}}}
```

## Update a database schema

> Update a database schema

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}":{"put":{"description":"Update a database schema","operationId":"V1UpdateProjDbSchema","requestBody":{"$ref":"#/components/requestBodies/DBSchemaUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/DBSchemaResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"Update a database schema","tags":["Database Schema"]}}},"components":{"requestBodies":{"DBSchemaUpdateRequest":{"content":{"application/json":{"schema":{"properties":{"changeLogScript":{"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"type":"object"},"changelog":{"additionalProperties":false,"description":"location of the changelog file containing schema changes in a git repository\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","type":"string"},"connector":{"description":"identifier of the harness git connector. To switch from a connector-based\nschema to Harness Code Repository, explicitly set this to empty string (\"\")\nalongside the repo field. Omitting this field retains the stored connector.\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","type":"string"},"location":{"description":"path to the change log file","type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"type":"object"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"name":{"description":"name of the database schema\n","maxLength":128,"type":"string"},"primaryDbInstanceId":{"description":"This is the primary db instance identifier for advanced feature like LLM Authoring etc.","type":"string"},"service":{"description":"harness service corresponding to database schema\n","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"Database Schema tags","maxProperties":128,"type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"usePercona":{"description":"if percona-tookit is enabled","type":"boolean"}},"type":"object"}}},"description":"Database schema update request","required":true}},"schemas":{"CloneResources":{"additionalProperties":false,"description":"Optional CPU/memory limits applied to DBOPS clone sub-steps\n(Git clone, Artifactory download, or custom Script run).\nWhen unset, pipeline step resources are used.\n","properties":{"limits":{"$ref":"#/components/schemas/ContainerResourceLimits"}},"type":"object"},"ContainerResourceLimits":{"additionalProperties":false,"description":"CPU and memory quantity limits for clone containers.\nCPU accepts cores (e.g. \"0.5\", \"1\") or millicores (e.g. \"400m\").\nMemory accepts Mi, Gi, M, G suffixes (e.g. \"500Mi\", \".5Gi\", \"1G\") or a unitless number.\n","properties":{"cpu":{"description":"CPU limit (e.g. 400m, 0.5, 1)","minLength":1,"type":"string"},"memory":{"description":"Memory limit (e.g. 500Mi, .5Gi, 1G)","minLength":1,"type":"string"}},"type":"object"},"DBSchemaType":{"description":"db schema type","enum":["Repository","Script"],"title":"DBSchemaType","type":"string"},"DBSchemaOut":{"description":"Database Schema Response","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"created":{"description":"epoch seconds when the database schema was created","format":"int64","type":"integer"},"identifier":{"description":"identifier of the database schema","type":"string"},"instanceCount":{"description":"number of database instances corresponding to database schema","format":"int64","type":"integer"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"parentId":{"description":"parentUniqueId for scope schema belongs to","type":"string"},"primaryDbInstanceId":{"description":"Identifier for the primary dbInstance used for advanced feature like LLM Authoring etc.","type":"string"},"schemaSourceType":{"enum":["Git","Artifactory","Custom","HarnessCode"],"readOnly":true,"type":"string"},"service":{"description":"harness service corresponding to database schema","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"updated":{"description":"epoch seconds when the database schema was last updated","format":"int64","type":"integer"},"usePercona":{"default":false,"description":"if percona-toolkit is enabled","type":"boolean"}},"required":["identifier","name","created","instanceCount","type","parentId","migrationType","usePercona"],"title":"Database Schema Response","type":"object"},"ChangeLogScript":{"additionalProperties":false,"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","minLength":1,"type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","minLength":1,"type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["image","command","shell","location"],"title":"changeLog script","type":"object"},"Changelog":{"additionalProperties":false,"description":"if schemaType is Repository location of the changelog file containing schema changes in a git repository.\nProvide connector for third-party git connectors, or repo without connector to use Harness Code Repository.\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","minLength":1,"type":"string"},"connector":{"description":"identifier of the harness git connector. Optional when using Harness Code Repository. Omit or set to empty string to use Harness Code Repository (requires `repo` to be set).\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","minLength":1,"type":"string"},"location":{"description":"path to the change log file","minLength":1,"type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","minLength":1,"type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["location"],"type":"object"},"MigrationType":{"default":"Liquibase","description":"DB Migration tool type","enum":["Liquibase","Flyway"],"title":"MigrationType","type":"string"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}},"responses":{"DBSchemaResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSchemaOut"}}},"description":"Response body for Database Schema"},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}}}}
```

## Delete a database schema

> Delete a database schema

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}":{"delete":{"description":"Delete a database schema","operationId":"V1DeleteProjDbSchema","responses":{"204":{"description":"The database schema was deleted successfully"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"Delete a database schema","tags":["Database Schema"]}}},"components":{"responses":{"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}},"schemas":{"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}}}}
```

## Update a database instance

> Update a database instance

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"tags":[{"description":"This contains APIs for performing CRUD operations on Database Schema Entity","name":"Database Schema"}],"paths":{"/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}/instance/{dbinstance}":{"put":{"description":"Update a database instance","operationId":"V1UpdateProjDbSchemaInstance","requestBody":{"$ref":"#/components/requestBodies/DBInstanceUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/DBInstanceResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"Update a database instance","tags":["Database Schema"]}}},"components":{"requestBodies":{"DBInstanceUpdateRequest":{"content":{"application/json":{"schema":{"properties":{"branch":{"description":"branch where the instance is stored","type":"string"},"commitSha":{"description":"Commit SHA to pin the changelog to a specific revision.\nMutually exclusive with branch and gitTag.\n","type":"string"},"connector":{"description":"DB Connector","type":"string"},"context":{"description":"Liquibase context","type":"string"},"gitTag":{"description":"Git tag to pin the changelog to a specific tagged revision.\nMutually exclusive with branch and commitSha.\n","type":"string"},"name":{"description":"name of the database instance\n","maxLength":128,"type":"string"},"substituteProperties":{"additionalProperties":{"type":"string"},"description":"Placeholder replacement in migration scripts.","type":"object"},"tags":{"additionalProperties":{"type":"string"},"description":"Database instance tags","maxProperties":128,"type":"object"},"version":{"description":"version of the changelog applied to the database","type":"string"}},"type":"object"}}},"description":"Database instance update request","required":true}},"responses":{"DBInstanceResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBInstanceOut"}}},"description":"Response body for Database Instance"},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}},"schemas":{"DBInstanceOut":{"description":"Database Instance Response","properties":{"branch":{"description":"branch where the instance is stored","type":"string"},"commitSha":{"description":"commit SHA to pin the changelog to a specific revision","type":"string"},"connector":{"description":"DB Connector","type":"string"},"context":{"description":"Liquibase context","type":"string"},"created":{"description":"epoch seconds when the database instance was created","format":"int64","type":"integer"},"gitTag":{"description":"Git tag to pin the changelog to a specific tagged revision","type":"string"},"identifier":{"description":"identifier of the database instance","type":"string"},"lastAppliedTag":{"description":"Most recent tag applied to the database","type":"string"},"lastDeployedChangeSetTag":{"description":"Tag on last deployed changeSet","type":"string"},"name":{"description":"name of the database instance","type":"string"},"schemaId":{"type":"string"},"schemaIdentifier":{"type":"string"},"substituteProperties":{"additionalProperties":{"type":"string"},"description":"Placeholder replacement in migration scripts.","type":"object"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database instance","type":"object"},"toOnboard":{"type":"boolean"},"updated":{"description":"epoch seconds when the database instance was last updated","format":"int64","type":"integer"}},"required":["identifier","name","created","connector","lastDeployedChangeSetTag"],"title":"Database Instance Response","type":"object"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}}}}
```
