mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	User following mechanics
This commit is contained in:
		
							
								
								
									
										31
									
								
								migrations/versions/7d51bc4b6079_.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								migrations/versions/7d51bc4b6079_.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
"""Add user_followers table
 | 
			
		||||
 | 
			
		||||
Revision ID: 7d51bc4b6079
 | 
			
		||||
Revises: 4aa88f253dab
 | 
			
		||||
Create Date: 2023-01-17 12:48:33.261942
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
from alembic import op
 | 
			
		||||
import sqlalchemy as sa
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# revision identifiers, used by Alembic.
 | 
			
		||||
revision = '7d51bc4b6079'
 | 
			
		||||
down_revision = '4aa88f253dab'
 | 
			
		||||
branch_labels = None
 | 
			
		||||
depends_on = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def upgrade():
 | 
			
		||||
    op.create_table(
 | 
			
		||||
        'user_followers',
 | 
			
		||||
        sa.Column('follower_user_id', sa.Integer(), nullable=False),
 | 
			
		||||
        sa.Column('followed_user_id', sa.Integer(), nullable=False),
 | 
			
		||||
        sa.ForeignKeyConstraint(['followed_user_id'], ['users.id'], ),
 | 
			
		||||
        sa.ForeignKeyConstraint(['follower_user_id'], ['users.id'], ),
 | 
			
		||||
        sa.PrimaryKeyConstraint('follower_user_id', 'followed_user_id')
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def downgrade():
 | 
			
		||||
    op.drop_table('user_followers')
 | 
			
		||||
		Reference in New Issue
	
	Block a user