mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-13 09:30:40 +00:00
Change directory structure (move ./nopaque/* to ./)
This commit is contained in:
1
migrations/README
Normal file
1
migrations/README
Normal file
@ -0,0 +1 @@
|
||||
Generic single-database configuration.
|
45
migrations/alembic.ini
Normal file
45
migrations/alembic.ini
Normal file
@ -0,0 +1,45 @@
|
||||
# A generic, single database configuration.
|
||||
|
||||
[alembic]
|
||||
# template used to generate migration files
|
||||
# file_template = %%(rev)s_%%(slug)s
|
||||
|
||||
# set to 'true' to run the environment during
|
||||
# the 'revision' command, regardless of autogenerate
|
||||
# revision_environment = false
|
||||
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
||||
keys = root,sqlalchemy,alembic
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARN
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[logger_sqlalchemy]
|
||||
level = WARN
|
||||
handlers =
|
||||
qualname = sqlalchemy.engine
|
||||
|
||||
[logger_alembic]
|
||||
level = INFO
|
||||
handlers =
|
||||
qualname = alembic
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(levelname)-5.5s [%(name)s] %(message)s
|
||||
datefmt = %H:%M:%S
|
96
migrations/env.py
Normal file
96
migrations/env.py
Normal file
@ -0,0 +1,96 @@
|
||||
from __future__ import with_statement
|
||||
|
||||
import logging
|
||||
from logging.config import fileConfig
|
||||
|
||||
from sqlalchemy import engine_from_config
|
||||
from sqlalchemy import pool
|
||||
|
||||
from alembic import context
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
|
||||
# Interpret the config file for Python logging.
|
||||
# This line sets up loggers basically.
|
||||
fileConfig(config.config_file_name)
|
||||
logger = logging.getLogger('alembic.env')
|
||||
|
||||
# add your model's MetaData object here
|
||||
# for 'autogenerate' support
|
||||
# from myapp import mymodel
|
||||
# target_metadata = mymodel.Base.metadata
|
||||
from flask import current_app
|
||||
config.set_main_option(
|
||||
'sqlalchemy.url', current_app.config.get(
|
||||
'SQLALCHEMY_DATABASE_URI').replace('%', '%%'))
|
||||
target_metadata = current_app.extensions['migrate'].db.metadata
|
||||
|
||||
# other values from the config, defined by the needs of env.py,
|
||||
# can be acquired:
|
||||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
|
||||
|
||||
def run_migrations_offline():
|
||||
"""Run migrations in 'offline' mode.
|
||||
|
||||
This configures the context with just a URL
|
||||
and not an Engine, though an Engine is acceptable
|
||||
here as well. By skipping the Engine creation
|
||||
we don't even need a DBAPI to be available.
|
||||
|
||||
Calls to context.execute() here emit the given string to the
|
||||
script output.
|
||||
|
||||
"""
|
||||
url = config.get_main_option("sqlalchemy.url")
|
||||
context.configure(
|
||||
url=url, target_metadata=target_metadata, literal_binds=True
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
def run_migrations_online():
|
||||
"""Run migrations in 'online' mode.
|
||||
|
||||
In this scenario we need to create an Engine
|
||||
and associate a connection with the context.
|
||||
|
||||
"""
|
||||
|
||||
# this callback is used to prevent an auto-migration from being generated
|
||||
# when there are no changes to the schema
|
||||
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
|
||||
def process_revision_directives(context, revision, directives):
|
||||
if getattr(config.cmd_opts, 'autogenerate', False):
|
||||
script = directives[0]
|
||||
if script.upgrade_ops.is_empty():
|
||||
directives[:] = []
|
||||
logger.info('No changes in schema detected.')
|
||||
|
||||
connectable = engine_from_config(
|
||||
config.get_section(config.config_ini_section),
|
||||
prefix='sqlalchemy.',
|
||||
poolclass=pool.NullPool,
|
||||
)
|
||||
|
||||
with connectable.connect() as connection:
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
process_revision_directives=process_revision_directives,
|
||||
**current_app.extensions['migrate'].configure_args
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
run_migrations_online()
|
24
migrations/script.py.mako
Normal file
24
migrations/script.py.mako
Normal file
@ -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"}
|
30
migrations/versions/099037c4aa06_.py
Normal file
30
migrations/versions/099037c4aa06_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 099037c4aa06
|
||||
Revises: 66253783654f
|
||||
Create Date: 2020-04-27 09:17:15.039728
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '099037c4aa06'
|
||||
down_revision = '66253783654f'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('last_seen', sa.DateTime(), nullable=True))
|
||||
op.add_column('users', sa.Column('setting_site_job_status_notifications', sa.String(length=16), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'setting_site_job_status_notifications')
|
||||
op.drop_column('users', 'last_seen')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/0aa38a7973c5_.py
Normal file
28
migrations/versions/0aa38a7973c5_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0aa38a7973c5
|
||||
Revises: 1210adfe1e34
|
||||
Create Date: 2019-11-06 09:33:46.296653
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0aa38a7973c5'
|
||||
down_revision = '1210adfe1e34'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('analysis_ip', sa.String(length=16), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpora', 'analysis_ip')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/0d7aed934679_.py
Normal file
28
migrations/versions/0d7aed934679_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0d7aed934679
|
||||
Revises: b15366b25bea
|
||||
Create Date: 2020-06-30 13:57:48.782173
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0d7aed934679'
|
||||
down_revision = 'b15366b25bea'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('result_files', sa.Column('corpus_metadata', sa.JSON(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('result_files', 'corpus_metadata')
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/10a92d8f4616_.py
Normal file
30
migrations/versions/10a92d8f4616_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 10a92d8f4616
|
||||
Revises: 4638e6509e13
|
||||
Create Date: 2020-05-12 11:24:46.022674
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '10a92d8f4616'
|
||||
down_revision = '4638e6509e13'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notifications_data', sa.Column('notified_on', sa.String(length=16), nullable=True))
|
||||
op.drop_column('notifications_data', 'notified')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notifications_data', sa.Column('notified', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.drop_column('notifications_data', 'notified_on')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/1210adfe1e34_.py
Normal file
28
migrations/versions/1210adfe1e34_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 1210adfe1e34
|
||||
Revises: abf60427ff84
|
||||
Create Date: 2019-11-04 12:54:39.389263
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1210adfe1e34'
|
||||
down_revision = 'abf60427ff84'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('status', sa.String(length=16), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpora', 'status')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/318074622d14_.py
Normal file
28
migrations/versions/318074622d14_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 318074622d14
|
||||
Revises: 0d7aed934679
|
||||
Create Date: 2020-06-30 14:00:18.968769
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '318074622d14'
|
||||
down_revision = '0d7aed934679'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('result_files', 'corpus_metadata')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('result_files', sa.Column('corpus_metadata', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/33ec4d09b4ca_.py
Normal file
30
migrations/versions/33ec4d09b4ca_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 33ec4d09b4ca
|
||||
Revises: 4cf5e5606a83
|
||||
Create Date: 2020-07-13 09:07:19.297185
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '33ec4d09b4ca'
|
||||
down_revision = '4cf5e5606a83'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('query_results', sa.Column('description', sa.String(length=255), nullable=True))
|
||||
op.add_column('query_results', sa.Column('title', sa.String(length=32), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('query_results', 'title')
|
||||
op.drop_column('query_results', 'description')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/389bcf564726_.py
Normal file
28
migrations/versions/389bcf564726_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 389bcf564726
|
||||
Revises: 318074622d14
|
||||
Create Date: 2020-06-30 14:03:33.384379
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '389bcf564726'
|
||||
down_revision = '318074622d14'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('result_files', sa.Column('corpus_metadata', sa.JSON(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('result_files', 'corpus_metadata')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/3d9a20b8b26c_.py
Normal file
28
migrations/versions/3d9a20b8b26c_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 3d9a20b8b26c
|
||||
Revises: 421ba4373e50
|
||||
Create Date: 2020-05-14 09:30:56.266381
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3d9a20b8b26c'
|
||||
down_revision = '421ba4373e50'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notification_email_data', sa.Column('notify_status', sa.String(length=16), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('notification_email_data', 'notify_status')
|
||||
# ### end Alembic commands ###
|
33
migrations/versions/421ba4373e50_.py
Normal file
33
migrations/versions/421ba4373e50_.py
Normal file
@ -0,0 +1,33 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 421ba4373e50
|
||||
Revises: 5ba6786a847e
|
||||
Create Date: 2020-05-14 08:35:47.367125
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '421ba4373e50'
|
||||
down_revision = '5ba6786a847e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('notification_email_data',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('job_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('notification_email_data')
|
||||
# ### end Alembic commands ###
|
38
migrations/versions/4638e6509e13_.py
Normal file
38
migrations/versions/4638e6509e13_.py
Normal file
@ -0,0 +1,38 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 4638e6509e13
|
||||
Revises: 471aa04c1a92
|
||||
Create Date: 2020-05-12 06:42:04.475585
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4638e6509e13'
|
||||
down_revision = '471aa04c1a92'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notifications_data', sa.Column('notified', sa.Boolean(), nullable=True))
|
||||
op.drop_column('notifications_data', 'notified_on_queued')
|
||||
op.drop_column('notifications_data', 'notified_on_running')
|
||||
op.drop_column('notifications_data', 'notified_on_submitted')
|
||||
op.drop_column('notifications_data', 'notified_on_complete')
|
||||
op.drop_column('notifications_data', 'notified_on_canceling')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notifications_data', sa.Column('notified_on_canceling', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.add_column('notifications_data', sa.Column('notified_on_complete', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.add_column('notifications_data', sa.Column('notified_on_submitted', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.add_column('notifications_data', sa.Column('notified_on_running', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.add_column('notifications_data', sa.Column('notified_on_queued', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.drop_column('notifications_data', 'notified')
|
||||
# ### end Alembic commands ###
|
38
migrations/versions/471aa04c1a92_.py
Normal file
38
migrations/versions/471aa04c1a92_.py
Normal file
@ -0,0 +1,38 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 471aa04c1a92
|
||||
Revises: 62233e0cb2c7
|
||||
Create Date: 2020-05-11 14:07:12.934869
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '471aa04c1a92'
|
||||
down_revision = '62233e0cb2c7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('notifications_data',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('job_id', sa.Integer(), nullable=True),
|
||||
sa.Column('notified_on_submitted', sa.Boolean(), nullable=True),
|
||||
sa.Column('notified_on_queued', sa.Boolean(), nullable=True),
|
||||
sa.Column('notified_on_running', sa.Boolean(), nullable=True),
|
||||
sa.Column('notified_on_complete', sa.Boolean(), nullable=True),
|
||||
sa.Column('notified_on_canceling', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('notifications_data')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/4886241e0f5d_.py
Normal file
28
migrations/versions/4886241e0f5d_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 4886241e0f5d
|
||||
Revises: 3d9a20b8b26c
|
||||
Create Date: 2020-05-14 11:58:08.498454
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4886241e0f5d'
|
||||
down_revision = '3d9a20b8b26c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('notification_email_data', sa.Column('creation_date', sa.DateTime(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('notification_email_data', 'creation_date')
|
||||
# ### end Alembic commands ###
|
36
migrations/versions/49a42c69e523_.py
Normal file
36
migrations/versions/49a42c69e523_.py
Normal file
@ -0,0 +1,36 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 49a42c69e523
|
||||
Revises: 099037c4aa06
|
||||
Create Date: 2020-04-27 11:18:32.999099
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '49a42c69e523'
|
||||
down_revision = '099037c4aa06'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('member_since', sa.DateTime(), nullable=True))
|
||||
op.add_column('users', sa.Column('setting_job_status_mail_notifications', sa.String(length=16), nullable=True))
|
||||
op.add_column('users', sa.Column('setting_job_status_site_notifications', sa.String(length=16), nullable=True))
|
||||
op.drop_column('users', 'setting_site_job_status_notifications')
|
||||
op.drop_column('users', 'registration_date')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('registration_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
|
||||
op.add_column('users', sa.Column('setting_site_job_status_notifications', sa.VARCHAR(length=16), autoincrement=False, nullable=True))
|
||||
op.drop_column('users', 'setting_job_status_site_notifications')
|
||||
op.drop_column('users', 'setting_job_status_mail_notifications')
|
||||
op.drop_column('users', 'member_since')
|
||||
# ### end Alembic commands ###
|
35
migrations/versions/4cf5e5606a83_.py
Normal file
35
migrations/versions/4cf5e5606a83_.py
Normal file
@ -0,0 +1,35 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 4cf5e5606a83
|
||||
Revises: e256f5cac75d
|
||||
Create Date: 2020-07-13 08:30:57.369850
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4cf5e5606a83'
|
||||
down_revision = 'e256f5cac75d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('query_results',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.Column('filename', sa.String(length=255), nullable=True),
|
||||
sa.Column('query_metadata', sa.JSON(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('query_results')
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/55d2b1a82ba9_.py
Normal file
30
migrations/versions/55d2b1a82ba9_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 55d2b1a82ba9
|
||||
Revises: 8b2e0d43384a
|
||||
Create Date: 2021-04-14 12:10:08.675542
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '55d2b1a82ba9'
|
||||
down_revision = '8b2e0d43384a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('jobs', 'mem_mb')
|
||||
op.drop_column('jobs', 'n_cores')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('jobs', sa.Column('n_cores', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('jobs', sa.Column('mem_mb', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
42
migrations/versions/5ba6786a847e_.py
Normal file
42
migrations/versions/5ba6786a847e_.py
Normal file
@ -0,0 +1,42 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 5ba6786a847e
|
||||
Revises: 10a92d8f4616
|
||||
Create Date: 2020-05-12 13:15:56.265610
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5ba6786a847e'
|
||||
down_revision = '10a92d8f4616'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('notification_data',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('job_id', sa.Integer(), nullable=True),
|
||||
sa.Column('notified_on', sa.String(length=16), nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.drop_table('notifications_data')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('notifications_data',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('job_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('notified_on', sa.VARCHAR(length=16), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], name='notifications_data_job_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='notifications_data_pkey')
|
||||
)
|
||||
op.drop_table('notification_data')
|
||||
# ### end Alembic commands ###
|
34
migrations/versions/62233e0cb2c7_.py
Normal file
34
migrations/versions/62233e0cb2c7_.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 62233e0cb2c7
|
||||
Revises: 68772b6560c3
|
||||
Create Date: 2020-05-04 09:42:25.408403
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '62233e0cb2c7'
|
||||
down_revision = '68772b6560c3'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('current_nr_of_tokens', sa.BigInteger(), nullable=True))
|
||||
op.add_column('corpora', sa.Column('max_nr_of_tokens', sa.BigInteger(), nullable=True))
|
||||
op.drop_column('corpora', 'analysis_container_name')
|
||||
op.drop_column('corpora', 'analysis_container_ip')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('analysis_container_ip', sa.VARCHAR(length=16), autoincrement=False, nullable=True))
|
||||
op.add_column('corpora', sa.Column('analysis_container_name', sa.VARCHAR(length=32), autoincrement=False, nullable=True))
|
||||
op.drop_column('corpora', 'max_nr_of_tokens')
|
||||
op.drop_column('corpora', 'current_nr_of_tokens')
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/6227310c2112_.py
Normal file
30
migrations/versions/6227310c2112_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 6227310c2112
|
||||
Revises: ded5a37f8a7b
|
||||
Create Date: 2020-01-30 09:28:06.770159
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6227310c2112'
|
||||
down_revision = 'ded5a37f8a7b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('job_results_job_input_id_fkey', 'job_results', type_='foreignkey')
|
||||
op.drop_column('job_results', 'job_input_id')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('job_results', sa.Column('job_input_id', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.create_foreign_key('job_results_job_input_id_fkey', 'job_results', 'job_inputs', ['job_input_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/66253783654f_.py
Normal file
30
migrations/versions/66253783654f_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 66253783654f
|
||||
Revises: 7378391345fa
|
||||
Create Date: 2020-04-27 08:26:19.772088
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '66253783654f'
|
||||
down_revision = '7378391345fa'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('setting_dark_mode', sa.Boolean(), nullable=True))
|
||||
op.drop_column('users', 'is_dark')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('is_dark', sa.BOOLEAN(), autoincrement=False, nullable=True))
|
||||
op.drop_column('users', 'setting_dark_mode')
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/68772b6560c3_.py
Normal file
28
migrations/versions/68772b6560c3_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 68772b6560c3
|
||||
Revises: 49a42c69e523
|
||||
Create Date: 2020-04-28 07:47:40.495698
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '68772b6560c3'
|
||||
down_revision = '49a42c69e523'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('last_edited_date', sa.DateTime(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpora', 'last_edited_date')
|
||||
# ### end Alembic commands ###
|
59
migrations/versions/6c2227f1cc77_.py
Normal file
59
migrations/versions/6c2227f1cc77_.py
Normal file
@ -0,0 +1,59 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 6c2227f1cc77
|
||||
Revises: befe5326787e
|
||||
Create Date: 2020-12-02 08:50:45.880062
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6c2227f1cc77'
|
||||
down_revision = 'befe5326787e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('notification_data')
|
||||
op.drop_table('notification_email_data')
|
||||
op.drop_column('corpus_files', 'dir')
|
||||
op.drop_column('job_inputs', 'dir')
|
||||
op.drop_column('job_results', 'dir')
|
||||
op.drop_column('jobs', 'secure_filename')
|
||||
op.alter_column('roles', 'permissions',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.Integer(),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('roles', 'permissions',
|
||||
existing_type=sa.Integer(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=True)
|
||||
op.add_column('jobs', sa.Column('secure_filename', sa.VARCHAR(length=32), autoincrement=False, nullable=True))
|
||||
op.add_column('job_results', sa.Column('dir', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
|
||||
op.add_column('job_inputs', sa.Column('dir', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('dir', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
|
||||
op.create_table('notification_email_data',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('job_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('notify_status', sa.VARCHAR(length=16), autoincrement=False, nullable=True),
|
||||
sa.Column('creation_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], name='notification_email_data_job_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='notification_email_data_pkey')
|
||||
)
|
||||
op.create_table('notification_data',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('job_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('notified_on', sa.VARCHAR(length=16), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], name='notification_data_job_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='notification_data_pkey')
|
||||
)
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/7378391345fa_.py
Normal file
28
migrations/versions/7378391345fa_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 7378391345fa
|
||||
Revises: 6227310c2112
|
||||
Create Date: 2020-02-17 12:29:17.851954
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7378391345fa'
|
||||
down_revision = '6227310c2112'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('jobs', sa.Column('secure_filename', sa.String(length=32), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('jobs', 'secure_filename')
|
||||
# ### end Alembic commands ###
|
32
migrations/versions/776761fb7466_.py
Normal file
32
migrations/versions/776761fb7466_.py
Normal file
@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 776761fb7466
|
||||
Revises: 0aa38a7973c5
|
||||
Create Date: 2019-11-07 08:34:01.676055
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '776761fb7466'
|
||||
down_revision = '0aa38a7973c5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('analysis_container_ip', sa.String(length=16), nullable=True))
|
||||
op.add_column('corpora', sa.Column('analysis_container_name', sa.String(length=32), nullable=True))
|
||||
op.drop_column('corpora', 'analysis_ip')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('analysis_ip', sa.VARCHAR(length=16), autoincrement=False, nullable=True))
|
||||
op.drop_column('corpora', 'analysis_container_name')
|
||||
op.drop_column('corpora', 'analysis_container_ip')
|
||||
# ### end Alembic commands ###
|
42
migrations/versions/790ce9512e75_.py
Normal file
42
migrations/versions/790ce9512e75_.py
Normal file
@ -0,0 +1,42 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 790ce9512e75
|
||||
Revises: 6c2227f1cc77
|
||||
Create Date: 2021-01-25 11:13:36.953269
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '790ce9512e75'
|
||||
down_revision = '6c2227f1cc77'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('corpora', 'current_nr_of_tokens',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.Integer(),
|
||||
existing_nullable=True)
|
||||
op.alter_column('corpora', 'max_nr_of_tokens',
|
||||
existing_type=sa.BIGINT(),
|
||||
type_=sa.Integer(),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('corpora', 'max_nr_of_tokens',
|
||||
existing_type=sa.Integer(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=True)
|
||||
op.alter_column('corpora', 'current_nr_of_tokens',
|
||||
existing_type=sa.Integer(),
|
||||
type_=sa.BIGINT(),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/8b2e0d43384a_.py
Normal file
28
migrations/versions/8b2e0d43384a_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 8b2e0d43384a
|
||||
Revises: 790ce9512e75
|
||||
Create Date: 2021-01-25 11:18:45.256537
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8b2e0d43384a'
|
||||
down_revision = '790ce9512e75'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpora', 'max_nr_of_tokens')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('max_nr_of_tokens', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
50
migrations/versions/9d21b228d353_.py
Normal file
50
migrations/versions/9d21b228d353_.py
Normal file
@ -0,0 +1,50 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 9d21b228d353
|
||||
Revises: 33ec4d09b4ca
|
||||
Create Date: 2020-07-15 08:58:59.062442
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '9d21b228d353'
|
||||
down_revision = '33ec4d09b4ca'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('corpus_files', 'author',
|
||||
existing_type=sa.VARCHAR(length=64),
|
||||
type_=sa.String(length=255),
|
||||
existing_nullable=True)
|
||||
op.alter_column('corpus_files', 'title',
|
||||
existing_type=sa.VARCHAR(length=64),
|
||||
type_=sa.String(length=255),
|
||||
existing_nullable=True)
|
||||
op.alter_column('roles', 'permissions',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.BigInteger(),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('roles', 'permissions',
|
||||
existing_type=sa.BigInteger(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=True)
|
||||
op.alter_column('corpus_files', 'title',
|
||||
existing_type=sa.String(length=255),
|
||||
type_=sa.VARCHAR(length=64),
|
||||
existing_nullable=True)
|
||||
op.alter_column('corpus_files', 'author',
|
||||
existing_type=sa.String(length=255),
|
||||
type_=sa.VARCHAR(length=64),
|
||||
existing_nullable=True)
|
||||
# ### end Alembic commands ###
|
32
migrations/versions/abf60427ff84_.py
Normal file
32
migrations/versions/abf60427ff84_.py
Normal file
@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: abf60427ff84
|
||||
Revises: da9fd175af8c
|
||||
Create Date: 2019-10-28 14:43:39.691313
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'abf60427ff84'
|
||||
down_revision = 'da9fd175af8c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpus_files', sa.Column('author', sa.String(length=64), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('publishing_year', sa.Integer(), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('title', sa.String(length=64), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpus_files', 'title')
|
||||
op.drop_column('corpus_files', 'publishing_year')
|
||||
op.drop_column('corpus_files', 'author')
|
||||
# ### end Alembic commands ###
|
42
migrations/versions/b15366b25bea_.py
Normal file
42
migrations/versions/b15366b25bea_.py
Normal file
@ -0,0 +1,42 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: b15366b25bea
|
||||
Revises: 4886241e0f5d
|
||||
Create Date: 2020-06-29 13:41:14.394680
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b15366b25bea'
|
||||
down_revision = '4886241e0f5d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('results',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('result_files',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('result_id', sa.Integer(), nullable=True),
|
||||
sa.Column('filename', sa.String(length=255), nullable=True),
|
||||
sa.Column('dir', sa.String(length=255), nullable=True),
|
||||
sa.ForeignKeyConstraint(['result_id'], ['results.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('result_files')
|
||||
op.drop_table('results')
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/befe5326787e_.py
Normal file
30
migrations/versions/befe5326787e_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: befe5326787e
|
||||
Revises: ecaf75fece7b
|
||||
Create Date: 2020-10-16 13:32:09.620960
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'befe5326787e'
|
||||
down_revision = 'ecaf75fece7b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('archive_file', sa.String(length=255), nullable=True))
|
||||
op.drop_column('corpora', 'archive_dir')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('archive_dir', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
|
||||
op.drop_column('corpora', 'archive_file')
|
||||
# ### end Alembic commands ###
|
43
migrations/versions/c3827cddea6e_.py
Normal file
43
migrations/versions/c3827cddea6e_.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: c3827cddea6e
|
||||
Revises: 9d21b228d353
|
||||
Create Date: 2020-07-15 12:33:24.574579
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c3827cddea6e'
|
||||
down_revision = '9d21b228d353'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('result_files')
|
||||
op.drop_table('results')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('result_files',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('result_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('filename', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
|
||||
sa.Column('dir', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['result_id'], ['results.id'], name='result_files_result_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='result_files_pkey')
|
||||
)
|
||||
op.create_table('results',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column('corpus_metadata', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='results_user_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='results_pkey')
|
||||
)
|
||||
# ### end Alembic commands ###
|
110
migrations/versions/da9fd175af8c_.py
Normal file
110
migrations/versions/da9fd175af8c_.py
Normal file
@ -0,0 +1,110 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: da9fd175af8c
|
||||
Revises:
|
||||
Create Date: 2019-10-23 08:11:02.741683
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'da9fd175af8c'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('roles',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.Column('name', sa.String(length=64), nullable=True),
|
||||
sa.Column('permissions', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
op.create_index(op.f('ix_roles_default'), 'roles', ['default'], unique=False)
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('confirmed', sa.Boolean(), nullable=True),
|
||||
sa.Column('email', sa.String(length=254), nullable=True),
|
||||
sa.Column('password_hash', sa.String(length=128), nullable=True),
|
||||
sa.Column('registration_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('role_id', sa.Integer(), nullable=True),
|
||||
sa.Column('username', sa.String(length=64), nullable=True),
|
||||
sa.Column('is_dark', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=True)
|
||||
op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
|
||||
op.create_table('corpora',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('creation_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('title', sa.String(length=32), nullable=True),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('jobs',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('creation_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('description', sa.String(length=255), nullable=True),
|
||||
sa.Column('end_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('mem_mb', sa.Integer(), nullable=True),
|
||||
sa.Column('n_cores', sa.Integer(), nullable=True),
|
||||
sa.Column('service', sa.String(length=64), nullable=True),
|
||||
sa.Column('service_args', sa.String(length=255), nullable=True),
|
||||
sa.Column('service_version', sa.String(length=16), nullable=True),
|
||||
sa.Column('status', sa.String(length=16), nullable=True),
|
||||
sa.Column('title', sa.String(length=32), nullable=True),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('corpus_files',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('filename', sa.String(length=255), nullable=True),
|
||||
sa.Column('dir', sa.String(length=255), nullable=True),
|
||||
sa.Column('corpus_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['corpus_id'], ['corpora.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('job_inputs',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('filename', sa.String(length=255), nullable=True),
|
||||
sa.Column('dir', sa.String(length=255), nullable=True),
|
||||
sa.Column('job_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('job_results',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('filename', sa.String(length=255), nullable=True),
|
||||
sa.Column('dir', sa.String(length=255), nullable=True),
|
||||
sa.Column('job_id', sa.Integer(), nullable=True),
|
||||
sa.Column('job_input_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
|
||||
sa.ForeignKeyConstraint(['job_input_id'], ['job_inputs.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('job_results')
|
||||
op.drop_table('job_inputs')
|
||||
op.drop_table('corpus_files')
|
||||
op.drop_table('jobs')
|
||||
op.drop_table('corpora')
|
||||
op.drop_index(op.f('ix_users_username'), table_name='users')
|
||||
op.drop_index(op.f('ix_users_email'), table_name='users')
|
||||
op.drop_table('users')
|
||||
op.drop_index(op.f('ix_roles_default'), table_name='roles')
|
||||
op.drop_table('roles')
|
||||
# ### end Alembic commands ###
|
44
migrations/versions/ded5a37f8a7b_.py
Normal file
44
migrations/versions/ded5a37f8a7b_.py
Normal file
@ -0,0 +1,44 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: ded5a37f8a7b
|
||||
Revises: 776761fb7466
|
||||
Create Date: 2020-01-08 14:39:32.182439
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ded5a37f8a7b'
|
||||
down_revision = '776761fb7466'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpus_files', sa.Column('address', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('booktitle', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('chapter', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('editor', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('institution', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('journal', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('pages', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('publisher', sa.String(length=255), nullable=True))
|
||||
op.add_column('corpus_files', sa.Column('school', sa.String(length=255), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpus_files', 'school')
|
||||
op.drop_column('corpus_files', 'publisher')
|
||||
op.drop_column('corpus_files', 'pages')
|
||||
op.drop_column('corpus_files', 'journal')
|
||||
op.drop_column('corpus_files', 'institution')
|
||||
op.drop_column('corpus_files', 'editor')
|
||||
op.drop_column('corpus_files', 'chapter')
|
||||
op.drop_column('corpus_files', 'booktitle')
|
||||
op.drop_column('corpus_files', 'address')
|
||||
# ### end Alembic commands ###
|
30
migrations/versions/e256f5cac75d_.py
Normal file
30
migrations/versions/e256f5cac75d_.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: e256f5cac75d
|
||||
Revises: 389bcf564726
|
||||
Create Date: 2020-07-01 07:45:24.637861
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'e256f5cac75d'
|
||||
down_revision = '389bcf564726'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('result_files', 'corpus_metadata')
|
||||
op.add_column('results', sa.Column('corpus_metadata', sa.JSON(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('results', 'corpus_metadata')
|
||||
op.add_column('result_files', sa.Column('corpus_metadata', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
28
migrations/versions/ecaf75fece7b_.py
Normal file
28
migrations/versions/ecaf75fece7b_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: ecaf75fece7b
|
||||
Revises: c3827cddea6e
|
||||
Create Date: 2020-10-16 13:31:30.681269
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ecaf75fece7b'
|
||||
down_revision = 'c3827cddea6e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('corpora', sa.Column('archive_dir', sa.String(length=255), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('corpora', 'archive_dir')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user