Kong / Kong/kong-python-pdk

How to handle plugin Schema migrations?

Open
#27 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Hi guys. I was learning how to create plugins for kong using the python-pdk and it wasn't clear how to handle plugin schema migrations.

From what I understand about lua-pdk, to handle migrations, it's just need to create a migrations directory inside the plugin directory and write the migrations with raw SQL in files in the following format 000_<custom_name>.lua, and in the file init.lua, inside the migrations directory, which I believe is equivalent to python's __init__.py, is necessary to return a set with the filenames in the order they should be applied.

It seems to me that kong already handles the discovery of migration files, and to apply them just run kong's CLI (kong migrations up).

Does this whole process also apply to python-pdk?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the python-pdk plugin structure with the lua-pdk migration convention described in the issue: the migrations directory, numbered migration files, migrations/init.lua, and the kong migrations up CLI command. Document whether this process applies to Python plugins, including the expected migration file layout and how migrations are discovered and run.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, database
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.