Skip to content

Commit

Permalink
Merge pull request #32 from Caleydo/release-2.0.1
Browse files Browse the repository at this point in the history
Release 2.0.1
  • Loading branch information
Anita Steiner authored May 2, 2022
2 parents 989daac + e11da3d commit 348d9ac
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 7 deletions.
18 changes: 15 additions & 3 deletions coral/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Copyright (c) The Caleydo Team. All rights reserved.
# Licensed under the new BSD license, available at http://caleydo.org/license
###############################################################################
from os import path

PROJ_NAME = 'coral'
DB_KEY = 'cohortdb'


def phovea(registry):
Expand All @@ -11,14 +15,22 @@ def phovea(registry):
:param registry:
"""
# generator-phovea:begin
registry.append('tdp-sql-database-definition', 'cohortdb', 'coral.db', {
'configKey': 'coral'
registry.append('tdp-sql-database-definition', DB_KEY, f'{PROJ_NAME}.db', {
'configKey': f'{PROJ_NAME}'
})

registry.append('namespace', 'db_connector', 'coral.sql', {
registry.append('namespace', 'db_connector', f'{PROJ_NAME}.sql', {
'namespace': '/api/cohortdb/db'
})
# generator-phovea:end

registry.append('tdp-sql-database-migration', DB_KEY, '', {
'scriptLocation': path.join(path.abspath(path.dirname(__file__)), 'migration'),
'configKey': f'{PROJ_NAME}.migration',
'dbKey': DB_KEY,
'versionTableSchema': 'public'
})

pass


Expand Down
1 change: 1 addition & 0 deletions coral/migration/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generic single-database configuration.
3 changes: 3 additions & 0 deletions coral/migration/env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import tdp_core.dbmigration_env # NOQA

tdp_core.dbmigration_env.run_migrations_online()
24 changes: 24 additions & 0 deletions coral/migration/script.py.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}


def upgrade():
${upgrades if upgrades else "pass"}


def downgrade():
${downgrades if downgrades else "pass"}
46 changes: 46 additions & 0 deletions coral/migration/versions/20220414_1158_ddd776aa28c3_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Create cohort schema, sequence and table
Revision ID: ddd776aa28c3
Revises:
Create Date: 2022-04-14 11:58:27.444788
"""
from alembic import op

# revision identifiers, used by Alembic.
revision = 'ddd776aa28c3'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
connection = op.get_bind()
for cmd in ["""
CREATE SCHEMA IF NOT EXISTS cohort;
CREATE SEQUENCE cohort.cohort_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 2147483647
CACHE 1;
""", """
CREATE TABLE cohort.cohort
(
id integer NOT NULL DEFAULT nextval('cohort.cohort_id_seq'::regclass),
name character varying COLLATE pg_catalog."default" NOT NULL,
is_initial integer NOT NULL,
previous_cohort integer,
entity_database character varying COLLATE pg_catalog."default" NOT NULL,
entity_schema character varying COLLATE pg_catalog."default" NOT NULL,
entity_table character varying COLLATE pg_catalog."default" NOT NULL,
statement character varying COLLATE pg_catalog."default",
CONSTRAINT cohort_pkey PRIMARY KEY (id)
);
"""]:
connection.execute(cmd)


def downgrade():
connection = op.get_bind()
connection.execute("DROP SCHEMA cohort CASCADE;")
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "coral",
"description": "Coral is a web-based cohort analysis tool to interactively create, refine, and analyze patient cohorts.",
"homepage": "https://caleydo.org",
"version": "2.0.0",
"version": "2.0.1",
"author": {
"name": "PatrickAdelberger",
"email": "coral@caleydo.org",
Expand Down Expand Up @@ -99,7 +99,7 @@
"react-dom": "^16.13.0",
"react-router-dom": "^5.2.0",
"split-grid": "^1.0.9",
"tdp_publicdb": "github:caleydo/tdp_publicdb#develop",
"tdp_publicdb": "github:caleydo/tdp_publicdb#semver:^11.0.0",
"tippy.js": "^6.2.6",
"tourdino": "github:caleydo/tourdino#keckelt/vega_boxplot",
"vega": "~5.20.0",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server
-e git+https://github.com/datavisyn/tdp_core.git@develop#egg=tdp_core
phovea_server>=9.0.0,<10.0.0
tdp_core>=14.0.2,<15.0.0

0 comments on commit 348d9ac

Please sign in to comment.