Skip to content

Commit

Permalink
regenerate initial migration
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Feb 25, 2019
1 parent 480aa58 commit 08193f8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 90 deletions.
24 changes: 0 additions & 24 deletions alembic/versions/0ca2cc448074_added_fingerprint.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
"""Initial migration
"""init
Revision ID: 5344fc3a3d3f
Revision ID: 2f363b3d680e
Revises:
Create Date: 2018-07-18 18:11:06.781732
Create Date: 2019-02-08 12:07:47.062397
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5344fc3a3d3f'
revision = '2f363b3d680e'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
op.create_table(
'users',
'sources',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.String(length=36), nullable=False),
sa.Column('username', sa.String(length=255), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('username')
sa.Column('journalist_designation', sa.String(length=255), nullable=False),
sa.Column('document_count', sa.Integer(), server_default='0', nullable=False),
sa.Column('is_flagged', sa.Boolean(name='is_flagged'), server_default='false',
nullable=True),
sa.Column('public_key', sa.Text(), nullable=True),
sa.Column('fingerprint', sa.String(length=64), nullable=True),
sa.Column('interaction_count', sa.Integer(), server_default='0', nullable=False),
sa.Column('is_starred', sa.Boolean(name='is_starred'), server_default='false',
nullable=True),
sa.Column('last_updated', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_sources')),
sa.UniqueConstraint('uuid', name=op.f('uq_sources_uuid'))
)
op.create_table(
'sources',
'users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.String(length=36), nullable=False),
sa.Column('journalist_designation', sa.String(length=255),
nullable=False),
sa.Column('is_flagged', sa.Boolean(name='ck_sources_is_flagged'),
nullable=True,
server_default="false"),
sa.Column('public_key', sa.Text(), nullable=True),
sa.Column('interaction_count', sa.Integer(), nullable=False,
server_default="0"),
sa.Column('is_starred', sa.Boolean(name='ck_sources_is_starred'),
nullable=True,
server_default="false"),
sa.Column('last_updated', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('uuid')
sa.Column('username', sa.String(length=255), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_users')),
sa.UniqueConstraint('uuid', name=op.f('uq_users_uuid'))
)
op.create_table(
'replies',
Expand All @@ -51,36 +49,34 @@ def upgrade():
sa.Column('source_id', sa.Integer(), nullable=True),
sa.Column('journalist_id', sa.Integer(), nullable=True),
sa.Column('filename', sa.String(length=255), nullable=False),
sa.Column('size', sa.Integer(), nullable=False),
sa.Column('is_downloaded', sa.Boolean(
name='ck_replies_is_downloaded'), nullable=True),
sa.ForeignKeyConstraint(['journalist_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['source_id'], ['sources.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('uuid')
sa.Column('size', sa.Integer(), nullable=True),
sa.Column('is_downloaded', sa.Boolean(name='is_downloaded'), nullable=True),
sa.ForeignKeyConstraint(['journalist_id'], ['users.id'],
name=op.f('fk_replies_journalist_id_users')),
sa.ForeignKeyConstraint(['source_id'], ['sources.id'],
name=op.f('fk_replies_source_id_sources')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_replies')),
sa.UniqueConstraint('uuid', name=op.f('uq_replies_uuid'))
)
op.create_table(
'submissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.String(length=36), nullable=False),
sa.Column('filename', sa.String(length=255), nullable=False),
sa.Column('size', sa.Integer(), nullable=False),
sa.Column('is_downloaded',
sa.Boolean(name='ck_submissions_is_downloaded'),
nullable=True),
sa.Column('is_read',
sa.Boolean(name='ck_submissions_is_read'),
nullable=True),
sa.Column('source_id', sa.Integer(), nullable=True),
sa.Column('download_url', sa.String(length=255), nullable=False),
sa.ForeignKeyConstraint(['source_id'], ['sources.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('uuid')
sa.Column('is_downloaded', sa.Boolean(name='is_downloaded'), nullable=True),
sa.Column('is_read', sa.Boolean(name='is_read'), nullable=True),
sa.Column('source_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['source_id'], ['sources.id'],
name=op.f('fk_submissions_source_id_sources')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_submissions')),
sa.UniqueConstraint('uuid', name=op.f('uq_submissions_uuid'))
)


def downgrade():
op.drop_table('users')
op.drop_table('submissions')
op.drop_table('replies')
op.drop_table('users')
op.drop_table('sources')
25 changes: 0 additions & 25 deletions alembic/versions/cd0fbb73bf8e_capture_document_count.py

This file was deleted.

0 comments on commit 08193f8

Please sign in to comment.