mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	add user_corpus m2m relationship
This commit is contained in:
		
							
								
								
									
										31
									
								
								migrations/versions/4aa88f253dab_.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								migrations/versions/4aa88f253dab_.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
"""Add corpus_followers table
 | 
			
		||||
 | 
			
		||||
Revision ID: 4aa88f253dab
 | 
			
		||||
Revises: 5b2a6e590166
 | 
			
		||||
Create Date: 2023-01-12 14:47:39.492875
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
from alembic import op
 | 
			
		||||
import sqlalchemy as sa
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# revision identifiers, used by Alembic.
 | 
			
		||||
revision = '4aa88f253dab'
 | 
			
		||||
down_revision = '5b2a6e590166'
 | 
			
		||||
branch_labels = None
 | 
			
		||||
depends_on = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def upgrade():
 | 
			
		||||
    op.create_table(
 | 
			
		||||
        'corpus_followers',
 | 
			
		||||
        sa.Column('user_id', sa.Integer(), nullable=False),
 | 
			
		||||
        sa.Column('corpus_id', sa.Integer(), nullable=False),
 | 
			
		||||
        sa.ForeignKeyConstraint(['corpus_id'], ['corpora.id'], ),
 | 
			
		||||
        sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
 | 
			
		||||
        sa.PrimaryKeyConstraint('user_id', 'corpus_id')
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def downgrade():
 | 
			
		||||
    op.drop_table('corpus_followers')
 | 
			
		||||
		Reference in New Issue
	
	Block a user