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: switch to alembic migrations #540

Merged
merged 7 commits into from Nov 13, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.