Documentation
¶
Overview ¶
Package upgrade provides the upgrade functionality which can be used while upgrading dgraph to a new version from an old version.
The code in this package is very much dependent on dgraph version. Please be very careful while modifying any files in this package. It is expected that only new files will be added over time in this package, and any change in existing files in not expected, as they would have been correct for the version of dgraph for which they were introduced. So, please double check whether you really need to modify any existing files.
When adding upgrade capability for a new dgraph release version, follow these steps:
- Create a file named `change_<release_version>.go`. For example: change_v20.07.0.go
- For any change that needs to be introduced in that version, create a function of the form `func() error` that applies that change, in the newly created file.
- Add that function to change_list.go inside the changes for the change set introduced in that version. Also add a short name and some meaningful description with it.
Points to keep in mind:
- Upgrade is expected only for breaking changes which go in as part of the breaking releases.
- Look at the upgrade algorithm in upgrade.go to understand how & when a change is applied.
- There are many re-usable functions in utils.go for the upgrade process, look at them too.
- Thoroughly test your upgrade to make sure that it works correctly while upgrading from previous versions to the new release version, as an upgrade is very critical process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Upgrade is the sub-command used to upgrade dgraph cluster. Upgrade x.SubCommand )
Functions ¶
func OfflineUpgradeFrom2011To2103 ¶
func OfflineUpgradeFrom2011To2103(db *badger.DB) error
OfflineUpgradeFrom2011To2103 upgrades a p directory restored from backup of 20.11 to the changes in 21.03. It fixes the cors, schema and drops the deprecated types/predicates.
Types ¶
type GraphQLParams ¶
type GraphQLResponse ¶
type GraphQLResponse struct { Data json.RawMessage `json:"data,omitempty"` Errors x.GqlErrorList `json:"errors,omitempty"` Extensions map[string]interface{} `json:"extensions,omitempty"` }
GraphQLResponse GraphQL response structure. see https://graphql.github.io/graphql-spec/June2018/#sec-Response