diff --git a/backend/migrations/versions/515abdefed7a_.py b/backend/migrations/versions/515abdefed7a_.py new file mode 100644 index 00000000..57529e6d --- /dev/null +++ b/backend/migrations/versions/515abdefed7a_.py @@ -0,0 +1,43 @@ +"""empty message + +Revision ID: 515abdefed7a +Revises: 4505f00c4ebd +Create Date: 2019-10-17 16:41:58.519224 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '515abdefed7a' +down_revision = '4505f00c4ebd' +branch_labels = None +depends_on = None + + +def upgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.create_table('proposal_subscribers', + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('proposal_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['proposal_id'], ['proposal.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) + ) + op.add_column('proposal', sa.Column('accepted_with_funding', sa.Boolean(), nullable=True)) + op.add_column('proposal', sa.Column('version', sa.String(length=255), nullable=True)) + op.alter_column('proposal', 'deadline_duration', + existing_type=sa.INTEGER(), + nullable=True) + # ### end Alembic commands ### + + +def downgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.alter_column('proposal', 'deadline_duration', + existing_type=sa.INTEGER(), + nullable=False) + op.drop_column('proposal', 'version') + op.drop_column('proposal', 'accepted_with_funding') + op.drop_table('proposal_subscribers') + # ### end Alembic commands ### diff --git a/backend/migrations/versions/7fea7427e9d6_.py b/backend/migrations/versions/7fea7427e9d6_.py new file mode 100644 index 00000000..3f88ba08 --- /dev/null +++ b/backend/migrations/versions/7fea7427e9d6_.py @@ -0,0 +1,47 @@ +"""empty message + +Revision ID: 7fea7427e9d6 +Revises: f24d53f211ef +Create Date: 2019-10-24 12:18:39.734758 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '7fea7427e9d6' +down_revision = 'f24d53f211ef' +branch_labels = None +depends_on = None + + +def upgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.create_table('rfp_liker', + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('rfp_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['rfp_id'], ['rfp.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) + ) + op.create_table('proposal_liker', + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('proposal_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['proposal_id'], ['proposal.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) + ) + op.create_table('comment_liker', + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('comment_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['comment_id'], ['comment.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) + ) + # ### end Alembic commands ### + + +def downgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.drop_table('comment_liker') + op.drop_table('proposal_liker') + op.drop_table('rfp_liker') + # ### end Alembic commands ### diff --git a/backend/migrations/versions/f24d53f211ef_.py b/backend/migrations/versions/f24d53f211ef_.py new file mode 100644 index 00000000..89219882 --- /dev/null +++ b/backend/migrations/versions/f24d53f211ef_.py @@ -0,0 +1,40 @@ +"""empty message + +Revision ID: f24d53f211ef +Revises: 515abdefed7a +Create Date: 2019-10-23 16:32:02.161367 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'f24d53f211ef' +down_revision = '515abdefed7a' +branch_labels = None +depends_on = None + + +def upgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.create_table('proposal_follower', + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('proposal_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['proposal_id'], ['proposal.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) + ) + op.drop_table('proposal_subscribers') + # ### end Alembic commands ### + + +def downgrade(): +# ### commands auto generated by Alembic - please adjust! ### + op.create_table('proposal_subscribers', + sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column('proposal_id', sa.INTEGER(), autoincrement=False, nullable=True), + sa.ForeignKeyConstraint(['proposal_id'], ['proposal.id'], name='proposal_subscribers_proposal_id_fkey'), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], name='proposal_subscribers_user_id_fkey') + ) + op.drop_table('proposal_follower') + # ### end Alembic commands ###