diff --git a/app/main/views.py b/app/main/views.py index 990f60d5..706ba250 100644 --- a/app/main/views.py +++ b/app/main/views.py @@ -29,8 +29,8 @@ def dashboard(): app = current_app._get_current_object() corpus = Corpus() corpus.creation_date = datetime.utcnow() - corpus.description = create_corpus_form.description.data, - corpus.title = create_corpus_form.title.data, + corpus.description = create_corpus_form.description.data + corpus.title = create_corpus_form.title.data corpus.user_id = current_user.id db.session.add(corpus) db.session.commit() diff --git a/migrations/versions/c425353fb4dc_add_creation_data_to_corpus.py b/migrations/versions/c425353fb4dc_add_creation_data_to_corpus.py deleted file mode 100644 index d580a9ba..00000000 --- a/migrations/versions/c425353fb4dc_add_creation_data_to_corpus.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Add creation_data to corpus - -Revision ID: c425353fb4dc -Revises: 3f2aee5e6a45 -Create Date: 2019-08-06 15:38:33.930052 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'c425353fb4dc' -down_revision = '3f2aee5e6a45' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('corpora', sa.Column('creation_data', sa.DateTime(), nullable=True)) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('corpora', 'creation_data') - # ### end Alembic commands ### diff --git a/migrations/versions/3f2aee5e6a45_initial_migrate.py b/migrations/versions/f148de896c56_initial_migrate.py similarity index 94% rename from migrations/versions/3f2aee5e6a45_initial_migrate.py rename to migrations/versions/f148de896c56_initial_migrate.py index 0d215299..0872bfa9 100644 --- a/migrations/versions/3f2aee5e6a45_initial_migrate.py +++ b/migrations/versions/f148de896c56_initial_migrate.py @@ -1,8 +1,8 @@ -"""Initial migrate +"""initial migrate -Revision ID: 3f2aee5e6a45 +Revision ID: f148de896c56 Revises: -Create Date: 2019-08-06 14:29:59.814876 +Create Date: 2019-08-06 15:42:19.487064 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = '3f2aee5e6a45' +revision = 'f148de896c56' down_revision = None branch_labels = None depends_on = None @@ -30,9 +30,9 @@ def upgrade(): op.create_table('users', sa.Column('id', sa.Integer(), nullable=False), sa.Column('confirmed', sa.Boolean(), nullable=True), - sa.Column('registration_date', sa.DateTime(), nullable=True), sa.Column('email', sa.String(length=64), 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.ForeignKeyConstraint(['role_id'], ['roles.id'], ), @@ -42,6 +42,7 @@ def upgrade(): 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=64), nullable=True), sa.Column('title', sa.String(length=32), nullable=True), sa.Column('user_id', sa.Integer(), nullable=True),