Commit babbc0c9 authored by sim's avatar sim

Alembic: move utilities to gargantext/utils

parent 323b1d6e
...@@ -78,7 +78,7 @@ ReplaceableObject recipe (see Alembic documentation). ...@@ -78,7 +78,7 @@ ReplaceableObject recipe (see Alembic documentation).
To create, drop or modify such object you need to make a ReplaceableObject To create, drop or modify such object you need to make a ReplaceableObject
instance, and then use create_*, drop_* or replace_* method of alembic.op. instance, and then use create_*, drop_* or replace_* method of alembic.op.
Conversion between ReplaceableObject and SQL is implemented in Conversion between ReplaceableObject and SQL is implemented in
gargantext/util/alembic.py. gargantext/utils/alembic.py.
* Views: create_view(ReplaceableObject(<name>, <query>)) * Views: create_view(ReplaceableObject(<name>, <query>))
* Roles: create_role(ReplaceableObject(<name>, <options>)) * Roles: create_role(ReplaceableObject(<name>, <options>))
...@@ -90,7 +90,7 @@ gargantext/util/alembic.py. ...@@ -90,7 +90,7 @@ gargantext/util/alembic.py.
Here is an example with a stored procedure: Here is an example with a stored procedure:
... ...
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
revision = '08230100f512' revision = '08230100f512'
... ...
...@@ -107,7 +107,7 @@ Here is an example with a stored procedure: ...@@ -107,7 +107,7 @@ Here is an example with a stored procedure:
To modify this stored procedure in a later revision: To modify this stored procedure in a later revision:
... ...
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
my_function_sp = ReplaceableObject( my_function_sp = ReplaceableObject(
"my_function()", "RETURNS integer AS $$ SELECT 43 $$ LANGUAGE sql") "my_function()", "RETURNS integer AS $$ SELECT 43 $$ LANGUAGE sql")
......
...@@ -7,7 +7,7 @@ Create Date: 2017-09-18 18:00:26.055335 ...@@ -7,7 +7,7 @@ Create Date: 2017-09-18 18:00:26.055335
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -8,7 +8,7 @@ Create Date: 2017-09-13 16:31:36.926692 ...@@ -8,7 +8,7 @@ Create Date: 2017-09-13 16:31:36.926692
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy_utils.types import TSVectorType from sqlalchemy_utils.types import TSVectorType
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2018-03-28 19:41:26.148413 ...@@ -7,7 +7,7 @@ Create Date: 2018-03-28 19:41:26.148413
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2017-10-06 17:23:27.765318 ...@@ -7,7 +7,7 @@ Create Date: 2017-10-06 17:23:27.765318
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2017-07-06 10:52:16.161118 ...@@ -7,7 +7,7 @@ Create Date: 2017-07-06 10:52:16.161118
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2017-09-15 14:14:51.737963 ...@@ -7,7 +7,7 @@ Create Date: 2017-09-15 14:14:51.737963
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2018-01-24 16:11:57.032715 ...@@ -7,7 +7,7 @@ Create Date: 2018-01-24 16:11:57.032715
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
...@@ -7,7 +7,7 @@ Create Date: 2017-10-12 15:23:40.481825 ...@@ -7,7 +7,7 @@ Create Date: 2017-10-12 15:23:40.481825
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from gargantext.util.alembic import ReplaceableObject from gargantext.utils.alembic import ReplaceableObject
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment