PermalinkBreaking Changes for Custom Entities and Plugins
Custom entities and plugins have the following breaking changes for 2.1.x
-
run_on
must be removed from the plugin schema. -
select_all
has been removed. The recommended fix path is to iterate all entities using:each
and filter entities in Lua. This works well for low cardinality (less than 5k entities). For higher cardinality entities, the recommendation is to write the queries in custom DAO code. Also, your use cases might be a good fit forselect_for
oreach_for
, that will work using database indices. Those methods are able to filter by a foreign key relation. -
Workspaceable entities and plugin entities need a migration.
PermalinkUpgrading custom workspaced entities
Kong 2.1.x will not start if it finds an entity that is marked as workspaceable but doesn’t comply with the latest data format needed. In that case, a list of the tables that should be migrated will be printed.
The command kong migrations upgrade-workspace-table [table-name]
prints a
temptative migration for an entity. The migration contents should be added as a
new migration for the entity like any other migration.
Any workspaceable entity in 2.1.x must incorporate the following changes:
PermalinkPostgres
- A
ws_id
field of type UUID, with a foreign key toworkspaces.id
- Unique fields do not require
<workspace_name>:
prefix, which must be removed.
PermalinkCassandra
- A
ws_id
field of type UUID - Unique fields must use
<workspace_id>:
as a prefix instead of<workspace_name>:
.