mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[Saved Objects] Update the migrationVersion
property to hold a plain string value (#150075)
* Update document migrator to rely on `typeMigrationVersion` instead of `migrationVersion`. * Refactor document migrator to extract migration pipeline logic. * Add `core` migration type.
This commit is contained in:
parent
1a0cab832d
commit
17876df41a
69 changed files with 1205 additions and 828 deletions
|
@ -25,7 +25,10 @@ export interface SavedObjectsBulkCreateObject<T = unknown> {
|
|||
version?: string;
|
||||
/** Array of references to other saved objects */
|
||||
references?: SavedObjectReference[];
|
||||
/** {@inheritDoc SavedObjectsMigrationVersion} */
|
||||
/**
|
||||
* {@inheritDoc SavedObjectsMigrationVersion}
|
||||
* @deprecated
|
||||
*/
|
||||
migrationVersion?: SavedObjectsMigrationVersion;
|
||||
/**
|
||||
* A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current
|
||||
|
@ -37,6 +40,8 @@ export interface SavedObjectsBulkCreateObject<T = unknown> {
|
|||
* field set and you want to create it again.
|
||||
*/
|
||||
coreMigrationVersion?: string;
|
||||
/** A semver value that is used when migrating documents between Kibana versions. */
|
||||
typeMigrationVersion?: string;
|
||||
/** Optional ID of the original saved object, if this object's `id` was regenerated */
|
||||
originId?: string;
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,10 @@ export interface SavedObjectsCreateOptions extends SavedObjectsBaseOptions {
|
|||
* Can be used in conjunction with `overwrite` for implementing optimistic concurrency control.
|
||||
**/
|
||||
version?: string;
|
||||
/** {@inheritDoc SavedObjectsMigrationVersion} */
|
||||
/**
|
||||
* {@inheritDoc SavedObjectsMigrationVersion}
|
||||
* @deprecated Use {@link SavedObjectsCreateOptions.typeMigrationVersion} instead.
|
||||
*/
|
||||
migrationVersion?: SavedObjectsMigrationVersion;
|
||||
/**
|
||||
* A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current
|
||||
|
@ -37,6 +40,10 @@ export interface SavedObjectsCreateOptions extends SavedObjectsBaseOptions {
|
|||
* field set and you want to create it again.
|
||||
*/
|
||||
coreMigrationVersion?: string;
|
||||
/**
|
||||
* A semver value that is used when migrating documents between Kibana versions.
|
||||
*/
|
||||
typeMigrationVersion?: string;
|
||||
/** Array of references to other saved objects */
|
||||
references?: SavedObjectReference[];
|
||||
/** The Elasticsearch Refresh setting for this operation */
|
||||
|
|
|
@ -21,8 +21,15 @@ export interface SavedObjectsIncrementCounterOptions<Attributes = unknown>
|
|||
* already exist. Existing fields will be left as-is and won't be incremented.
|
||||
*/
|
||||
initialize?: boolean;
|
||||
/** {@link SavedObjectsMigrationVersion} */
|
||||
/**
|
||||
* {@link SavedObjectsMigrationVersion}
|
||||
* @deprecated
|
||||
*/
|
||||
migrationVersion?: SavedObjectsMigrationVersion;
|
||||
/**
|
||||
* A semver value that is used when migrating documents between Kibana versions.
|
||||
*/
|
||||
typeMigrationVersion?: string;
|
||||
/**
|
||||
* (default='wait_for') The Elasticsearch refresh setting for this
|
||||
* operation. See {@link MutatingOperationRefreshSetting}
|
||||
|
|
|
@ -76,7 +76,6 @@ export interface ISavedObjectsRepository {
|
|||
* @param {object} [options={}] {@link SavedObjectsCreateOptions} - options for the create operation
|
||||
* @property {string} [options.id] - force id on creation, not recommended
|
||||
* @property {boolean} [options.overwrite=false]
|
||||
* @property {object} [options.migrationVersion=undefined]
|
||||
* @property {string} [options.namespace]
|
||||
* @property {array} [options.references=[]] - [{ name, type, id }]
|
||||
* @returns {promise} the created saved object { id, type, version, attributes }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue