Skip to content

Commit

Permalink
Merge pull request #540 from ckan/switch-to-alembic
Browse files Browse the repository at this point in the history
feat: switch to alembic migrations
  • Loading branch information
pdelboca committed Nov 13, 2023
2 parents 9fb44f7 + b278b8a commit c2ef796
Show file tree
Hide file tree
Showing 25 changed files with 774 additions and 853 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -57,6 +57,6 @@ jobs:
- name: Setup extension (CKAN >= 2.9)
run: |
ckan -c test.ini db init
ckan -c test.ini harvester initdb
ckan -c test.ini db pending-migrations --apply
- name: Run tests
run: pytest --ckan-ini=test.ini --cov=ckanext.harvest --disable-warnings ckanext/harvest/tests
5 changes: 1 addition & 4 deletions README.rst
Expand Up @@ -94,7 +94,7 @@ Configuration

Run the following command to create the necessary tables in the database (ensuring the pyenv is activated):

(pyenv) $ ckan --config=/etc/ckan/default/ckan.ini harvester initdb
(pyenv) $ ckan --config=/etc/ckan/default/ckan.ini db upgrade -p harvest

Finally, restart CKAN to have the changes take effect::

Expand Down Expand Up @@ -229,9 +229,6 @@ Command line interface

The following operations can be run from the command line as described underneath::

harvester initdb
- Creates the necessary tables in the database

harvester source {name} {url} {type} [{title}] [{active}] [{owner_org}] [{frequency}] [{config}]
- create new harvest source

Expand Down
9 changes: 0 additions & 9 deletions ckanext/harvest/cli.py
Expand Up @@ -20,14 +20,6 @@ def harvester():
pass


@harvester.command()
def initdb():
"""Creates the necessary tables in the database.
"""
utils.initdb()
click.secho(u"DB tables created", fg=u"green")


@harvester.group()
def source():
"""Manage harvest sources
Expand Down Expand Up @@ -337,7 +329,6 @@ def import_stage(
import. e.g. 15af will run segments 1,5,a,f
"""
ctx.invoke(initdb)
flask_app = ctx.meta["flask_app"]
with flask_app.test_request_context():
try:
Expand Down
8 changes: 0 additions & 8 deletions ckanext/harvest/commands/__init__.py

This file was deleted.

0 comments on commit c2ef796

Please sign in to comment.