Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

data (migration step)

Inserts, updates or deletes rows of a table on every engine, the values quoted by the connection.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/migration-steps/data.md

On this page

data

Inserts, updates or deletes rows of a table on every engine, the values quoted by the connection.

A step of a YAML migration with type: data. The class expMigrationStepData (kernel/classes/migration/steps/expmigrationstepdata.php) is registered in settings/migration.ini [StepSettings] StepTypeList[data].

Modes

mode: is one of insert, ensure, update, delete; every step names one.

Keys

KeyTypeModesDefaultWhat it is
tablestringallrequiredthe table (a collection on MongoDB)
rowslistinsert, ensurerequiredthe rows, each column => value
keylistensurerequiredthe columns that find a row
id_columnstringinsert, ensurethe auto_increment column; its value of the last row inserted is the result's id
wheremapupdate, deletecolumn => value (a list: one of them; null: is null)
valuesmapupdaterequiredcolumn => new value
allboolupdate, deletefalsetrue: every row, without where

Besides these, every step takes the keys of the engine: type, mode, if, references, environments, engines and comment (the file format). A key of type identifier names a node, an object or another part of the installation by id, remote id, path or name (identifiers).

Values for references

references: { <name>: <value> } keeps a value of the step's result as ${ref.<name>} for the steps and migrations after it:

ValueWhat it is
counthow many rows were inserted, updated or deleted
idinsert, ensure: the id_column of the last row inserted (null when none was)

Undoing

A step of this type does not undo itself: a migration with it needs down: or a rollback to its caption.

It touches no cache.

Example

- type: data
  mode: ensure
  table: ezsite_data
  key: [ name ]
  rows:
    - { name: news_list_limit, value: "20" }

Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepdata.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x