Add automatic storage replication
Adds a worker to automatically replicate data between storages and update the database accordingly
This commit is contained in:
parent
c693afca6a
commit
724b1607d7
18 changed files with 259 additions and 35 deletions
35
data/migrations/versions/9512773a4a2_add_userregion_table.py
Normal file
35
data/migrations/versions/9512773a4a2_add_userregion_table.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
"""Add UserRegion table
|
||||
|
||||
Revision ID: 9512773a4a2
|
||||
Revises: 499f6f08de3
|
||||
Create Date: 2015-09-01 14:17:08.628052
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '9512773a4a2'
|
||||
down_revision = '499f6f08de3'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('userregion',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('location_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['location_id'], ['imagestoragelocation.id'], name=op.f('fk_userregion_location_id_imagestoragelocation')),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('fk_userregion_user_id_user')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_userregion'))
|
||||
)
|
||||
op.create_index('userregion_location_id', 'userregion', ['location_id'], unique=False)
|
||||
op.create_index('userregion_user_id', 'userregion', ['user_id'], unique=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('userregion')
|
||||
### end Alembic commands ###
|
Reference in a new issue