model changes, user institution history, style changes, forgot passowrd functionality, etc.

This commit is contained in:
msinkec
2021-09-02 14:40:54 +02:00
parent 7da73f7d6a
commit 788f3bc3eb
25 changed files with 551 additions and 176 deletions

View File

@@ -0,0 +1,37 @@
"""Added UserCooperationHistory.
Revision ID: 4c132220432f
Revises: ff356b1ef661
Create Date: 2021-09-01 09:25:43.144096
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4c132220432f'
down_revision = 'ff356b1ef661'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user_cooperation',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user', sa.Integer(), nullable=False),
sa.Column('institution', sa.Integer(), nullable=False),
sa.Column('role', sa.String(), nullable=False),
sa.Column('badge_text', sa.String(), nullable=True),
sa.ForeignKeyConstraint(['institution'], ['institution.id'], ),
sa.ForeignKeyConstraint(['user'], ['registered_user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_cooperation')
# ### end Alembic commands ###

View File

@@ -0,0 +1,28 @@
"""Added school year column to user history.
Revision ID: c60b7bfaaf85
Revises: 4c132220432f
Create Date: 2021-09-02 08:36:41.711040
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c60b7bfaaf85'
down_revision = '4c132220432f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user_cooperation', sa.Column('school_year', sa.String(), nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user_cooperation', 'school_year')
# ### end Alembic commands ###

View File

@@ -0,0 +1,58 @@
"""Dropped out predavanje stuff, added contract initial file name.
Revision ID: ff356b1ef661
Revises: 5ba116fc7f06
Create Date: 2021-08-26 12:45:56.036966
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'ff356b1ef661'
down_revision = '5ba116fc7f06'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('stamps_solar')
op.drop_table('upload_predavanja')
op.add_column('contracts_solar', sa.Column('original_filename', sa.String(), nullable=True))
op.add_column('institution_contract', sa.Column('original_filename', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('institution_contract', 'original_filename')
op.drop_column('contracts_solar', 'original_filename')
op.create_table('upload_predavanja',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('upload_hash', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('timestamp', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('address', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('subject', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('faculty', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('email', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('phone', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('keywords', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('file_contract', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('upload_file_hashes', postgresql.ARRAY(sa.VARCHAR()), autoincrement=False, nullable=True),
sa.Column('agree_publish_future', sa.TEXT(), autoincrement=False, nullable=False),
sa.Column('agree_machine_translation', sa.BOOLEAN(), autoincrement=False, nullable=False),
sa.Column('agree_news_cjvt', sa.BOOLEAN(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='upload_predavanja_pkey')
)
op.create_table('stamps_solar',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('institution', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('name', sa.TEXT(), autoincrement=False, nullable=False),
sa.Column('file_logo', sa.TEXT(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['institution'], ['institution.id'], name='stamps_institution_fkey'),
sa.PrimaryKeyConstraint('id', name='stamps_pkey')
)
# ### end Alembic commands ###