Add function to import exported results and view them after the import

This commit is contained in:
Stephan Porada
2020-07-03 14:41:57 +02:00
parent a997fbe0ee
commit 1811623583
27 changed files with 880 additions and 32 deletions

View 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 ###

View 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 ###

View 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 ###

View 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 ###

View 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 ###