Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat/migrations] split plugins migrations #443

Merged
merged 8 commits into from
Aug 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
## [Unreleased][unreleased]

#### Added
This release contains breaking changes.

- The Basic Authentication plugin now supports credentials in the `Proxy-Authorization` header. [#460](https://github.com/Mashape/kong/issues/460)
### Breaking changes

#### Changed
- The database schema has been updated to be future proof and handle the separation of plugins outside of the core repository. Please follow the instructions in [UPDATE.md](/UPDATE.md#update-to-kong-050).

#### Fixed
#### Added

- Plugins migrations. Each plugin can now have its own migration scripts if it needs to store data in your cluster. This is a step forward to improve Kong's pluggable architecture. [#443](https://github.com/Mashape/kong/pull/443)
- The Basic Authentication plugin now supports credentials in the `Proxy-Authorization` header. [#460](https://github.com/Mashape/kong/issues/460)

## [0.4.2] - 2015/08/10

Expand Down
30 changes: 30 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
This document describes eventual additional steps that might be required to update between two versions of Kong. If nothing is described here for a particular version and platform, then assume the update will go smoothly.

## Update to Kong `0.5.0`

It is important that you be running Kong `0.4.2` and have the latest release of Python 2.7 on your system when executing those steps.

The database schema slightly changed to introduce "plugins migrations". Now, each plugin can have its own migration if it needs to store data in your cluster. This is not a regular migration since the schema of the table handling the migrations itself changed. [This Python script](/scripts/migration.py) will take care of migrating your database schema should you execute the following instructions:

```shell
# First, make sure you are already running Kong 0.4.2

# clone the Kong git repository if you don't already have it:
$ git clone git@github.com:Mashape/kong.git

# go to the 'scripts/' folder:
$ cd kong/scripts

# The script will use your first contact point (the first of the 'hosts' property)
# so make sure it is valid and has the format 'host:port'.

# Execute the migration script:
$ python migration.py -c /path/to/kong/config

# If everything went well the script should print a success message.

# You can now update Kong to 0.5.0.
# After updating, reload Kong to avoid downtime:
$ kong reload
```

Your cluster should successfully be migrated to Kong `0.5.0`.

## Update to Kong `0.4.2`

The configuration format for specifying the port of your Cassandra instance changed. Replace:
Expand Down
65 changes: 0 additions & 65 deletions database/migrations/cassandra/2015-01-12-175310_init_schema.lua

This file was deleted.

47 changes: 0 additions & 47 deletions database/migrations/cassandra/2015-04-24-154530_plugins.lua

This file was deleted.

27 changes: 0 additions & 27 deletions database/migrations/cassandra/2015-05-22-235608_0.3.0.lua

This file was deleted.

63 changes: 0 additions & 63 deletions database/migrations/cassandra/2015-06-09-170921_0.4.0.lua

This file was deleted.

17 changes: 0 additions & 17 deletions database/migrations/cassandra/2015-08-10-813213_0.4.2.lua

This file was deleted.

10 changes: 7 additions & 3 deletions kong-0.4.2-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = {
"yaml ~> 1.1.1-1",
"lapis ~> 1.1.0-1",
"stringy ~> 0.4-1",
"lua-cassandra ~> 0.3.5-0",
"lua-cassandra ~> 0.3.6-0",
"multipart ~> 0.1-3",
"lua-path ~> 0.2.3-1",
"lua-cjson ~> 2.1.0-1",
Expand Down Expand Up @@ -79,6 +79,7 @@ build = {
["kong.reports.init_worker"] = "kong/reports/init_worker.lua",
["kong.reports.log"] = "kong/reports/log.lua",

["kong.dao.cassandra.schema.migrations"] = "kong/dao/cassandra/schema/migrations.lua",
["kong.dao.error"] = "kong/dao/error.lua",
["kong.dao.schemas_validation"] = "kong/dao/schemas_validation.lua",
["kong.dao.schemas.apis"] = "kong/dao/schemas/apis.lua",
Expand All @@ -94,18 +95,21 @@ build = {

["kong.plugins.base_plugin"] = "kong/plugins/base_plugin.lua",

["kong.plugins.basicauth.migrations.cassandra"] = "kong/plugins/basicauth/migrations/cassandra.lua",
["kong.plugins.basicauth.handler"] = "kong/plugins/basicauth/handler.lua",
["kong.plugins.basicauth.access"] = "kong/plugins/basicauth/access.lua",
["kong.plugins.basicauth.schema"] = "kong/plugins/basicauth/schema.lua",
["kong.plugins.basicauth.api"] = "kong/plugins/basicauth/api.lua",
["kong.plugins.basicauth.daos"] = "kong/plugins/basicauth/daos.lua",

["kong.plugins.keyauth.migrations.cassandra"] = "kong/plugins/keyauth/migrations/cassandra.lua",
["kong.plugins.keyauth.handler"] = "kong/plugins/keyauth/handler.lua",
["kong.plugins.keyauth.access"] = "kong/plugins/keyauth/access.lua",
["kong.plugins.keyauth.schema"] = "kong/plugins/keyauth/schema.lua",
["kong.plugins.keyauth.api"] = "kong/plugins/keyauth/api.lua",
["kong.plugins.keyauth.daos"] = "kong/plugins/keyauth/daos.lua",

["kong.plugins.oauth2.migrations.cassandra"] = "kong/plugins/oauth2/migrations/cassandra.lua",
["kong.plugins.oauth2.handler"] = "kong/plugins/oauth2/handler.lua",
["kong.plugins.oauth2.access"] = "kong/plugins/oauth2/access.lua",
["kong.plugins.oauth2.schema"] = "kong/plugins/oauth2/schema.lua",
Expand Down Expand Up @@ -136,6 +140,7 @@ build = {
["kong.plugins.mashape-analytics.schema"] = "kong/plugins/mashape-analytics/schema.lua",
["kong.plugins.mashape-analytics.buffer"] = "kong/plugins/mashape-analytics/buffer.lua",

["kong.plugins.ratelimiting.migrations.cassandra"] = "kong/plugins/ratelimiting/migrations/cassandra.lua",
["kong.plugins.ratelimiting.handler"] = "kong/plugins/ratelimiting/handler.lua",
["kong.plugins.ratelimiting.access"] = "kong/plugins/ratelimiting/access.lua",
["kong.plugins.ratelimiting.schema"] = "kong/plugins/ratelimiting/schema.lua",
Expand Down Expand Up @@ -181,6 +186,5 @@ build = {
install = {
conf = { "kong.yml" },
bin = { "bin/kong" }
},
copy_directories = { "database/migrations/" }
}
}
Loading