-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #831 from hammerlab/comments-with-users
Associate comments with users and use username for author name
- Loading branch information
Showing
29 changed files
with
161 additions
and
93 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
alembic/versions/1ab5aa1e3054_start_associating_comments_with_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Adds user_id column to the user_comments and drops the author_name column. | ||
This allows us to associate comments with users in the database. | ||
Revision ID: 1ab5aa1e3054 | ||
Revises: 2c00861f3ff1 | ||
Create Date: 2015-09-01 18:05:35.598253 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1ab5aa1e3054' | ||
down_revision = '2c00861f3ff1' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
def upgrade(): | ||
op.drop_column('user_comments', 'author_name') | ||
op.add_column('user_comments', | ||
sa.Column('user_id', | ||
sa.BigInteger, | ||
sa.ForeignKey('users.id'))) | ||
|
||
def downgrade(): | ||
op.drop_column('user_comments', 'user_id') | ||
op.add_column('user_comments', sa.Column('author_name', sa.String()),) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,6 +195,5 @@ def abort_if_none(obj, obj_id): | |
return obj | ||
return abort_if_none | ||
|
||
|
||
class CollisionError(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.