diff --git a/alembic/versions/15ea3c2cf83d_adding_column_to_store_edited_by_and_.py b/alembic/versions/15ea3c2cf83d_adding_column_to_store_edited_by_and_.py deleted file mode 100644 index f301dd0..0000000 --- a/alembic/versions/15ea3c2cf83d_adding_column_to_store_edited_by_and_.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Adding column to store edited_by and edited_on a comment - -Revision ID: 15ea3c2cf83d -Revises: 1cd0a853c697 -Create Date: 2015-11-09 16:18:47.192088 - -""" - -# revision identifiers, used by Alembic. -revision = '15ea3c2cf83d' -down_revision = '1cd0a853c697' - -from alembic import op -import sqlalchemy as sa - - -def upgrade(): - ''' Add the columns editor_id and edited_on to the table - pull_request_comments. - ''' - - op.add_column( - 'pull_request_comments', - sa.Column( - 'editor_id', - sa.Integer, - sa.ForeignKey('users.id', onupdate='CASCADE'), - nullable=True) - ) - - op.add_column( - 'pull_request_comments', - sa.Column( - 'edited_on', - sa.DateTime, - nullable=True) - ) - - -def downgrade(): - ''' Remove the columns editor_id and edited_on from the table - pull_request_comments. - ''' - op.drop_column('pull_request_comments', 'editor_id') - op.drop_column('pull_request_comments', 'edited_on') diff --git a/alembic/versions/15ea3c2cf83d_pr_comment_edition.py b/alembic/versions/15ea3c2cf83d_pr_comment_edition.py new file mode 100644 index 0000000..ad3eedc --- /dev/null +++ b/alembic/versions/15ea3c2cf83d_pr_comment_edition.py @@ -0,0 +1,45 @@ +"""Adding column to store edited_by and edited_on a PR comment + +Revision ID: 15ea3c2cf83d +Revises: 1cd0a853c697 +Create Date: 2015-11-09 16:18:47.192088 + +""" + +# revision identifiers, used by Alembic. +revision = '15ea3c2cf83d' +down_revision = '1cd0a853c697' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ''' Add the columns editor_id and edited_on to the table + pull_request_comments. + ''' + + op.add_column( + 'pull_request_comments', + sa.Column( + 'editor_id', + sa.Integer, + sa.ForeignKey('users.id', onupdate='CASCADE'), + nullable=True) + ) + + op.add_column( + 'pull_request_comments', + sa.Column( + 'edited_on', + sa.DateTime, + nullable=True) + ) + + +def downgrade(): + ''' Remove the columns editor_id and edited_on from the table + pull_request_comments. + ''' + op.drop_column('pull_request_comments', 'editor_id') + op.drop_column('pull_request_comments', 'edited_on') diff --git a/alembic/versions/3b441ef4e928_issue_comment_edition.py b/alembic/versions/3b441ef4e928_issue_comment_edition.py new file mode 100644 index 0000000..60f5e87 --- /dev/null +++ b/alembic/versions/3b441ef4e928_issue_comment_edition.py @@ -0,0 +1,44 @@ +"""Adding column to store edited_by and edited_on a issue comment + +Revision ID: 3b441ef4e928 +Revises: 15ea3c2cf83d +Create Date: 2015-12-03 12:34:28.316699 + +""" + +# revision identifiers, used by Alembic. +revision = '3b441ef4e928' +down_revision = '15ea3c2cf83d' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ''' Add the columns editor_id and edited_on to the table issue_comments. + ''' + + op.add_column( + 'issue_comments', + sa.Column( + 'editor_id', + sa.Integer, + sa.ForeignKey('users.id', onupdate='CASCADE'), + nullable=True) + ) + + op.add_column( + 'issue_comments', + sa.Column( + 'edited_on', + sa.DateTime, + nullable=True) + ) + + +def downgrade(): + ''' Remove the columns editor_id and edited_on from the table + issue_comments. + ''' + op.drop_column('issue_comments', 'editor_id') + op.drop_column('issue_comments', 'edited_on') diff --git a/alembic/versions/3b441ef4e928_issue_editors.py b/alembic/versions/3b441ef4e928_issue_editors.py deleted file mode 100644 index 07d487c..0000000 --- a/alembic/versions/3b441ef4e928_issue_editors.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Issue editors - -Revision ID: 3b441ef4e928 -Revises: 15ea3c2cf83d -Create Date: 2015-12-03 12:34:28.316699 - -""" - -# revision identifiers, used by Alembic. -revision = '3b441ef4e928' -down_revision = '15ea3c2cf83d' - -from alembic import op -import sqlalchemy as sa - - -def upgrade(): - ''' Add the columns editor_id and edited_on to the table issue_comments. - ''' - - op.add_column( - 'issue_comments', - sa.Column( - 'editor_id', - sa.Integer, - sa.ForeignKey('users.id', onupdate='CASCADE'), - nullable=True) - ) - - op.add_column( - 'issue_comments', - sa.Column( - 'edited_on', - sa.DateTime, - nullable=True) - ) - - -def downgrade(): - ''' Remove the columns editor_id and edited_on from the table - issue_comments. - ''' - op.drop_column('issue_comments', 'editor_id') - op.drop_column('issue_comments', 'edited_on')