Skip to content

Commit

Permalink
ran db revision script
Browse files Browse the repository at this point in the history
  • Loading branch information
allisongu committed Apr 22, 2020
1 parent f2e992c commit 74e2bf2
Showing 1 changed file with 174 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
"""added tag column to bill model
Revision ID: 321d3f042213
Revises: cb038f79982e
Create Date: 2020-04-22 15:15:17.617333
"""

# revision identifiers, used by Alembic.
revision = '321d3f042213'
down_revision = 'cb038f79982e'

from alembic import op
import sqlalchemy as sa

def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column("bill", sa.Column("tag", sa.UnicodeText(), nullable=True))
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column("bill", "tag")
### end Alembic commands ###



# def upgrade():
# # ### commands auto generated by Alembic - please adjust! ###
# op.create_table('bill_version',
# sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
# sa.Column('payer_id', sa.Integer(), autoincrement=False, nullable=True),
# sa.Column('amount', sa.Float(), autoincrement=False, nullable=True),
# sa.Column('date', sa.Date(), autoincrement=False, nullable=True),
# sa.Column('creation_date', sa.Date(), autoincrement=False, nullable=True),
# sa.Column('what', sa.UnicodeText(), autoincrement=False, nullable=True),
# sa.Column('tag', sa.UnicodeText(), autoincrement=False, nullable=True),
# sa.Column('external_link', sa.UnicodeText(), autoincrement=False, nullable=True),
# sa.Column('archive', sa.Integer(), autoincrement=False, nullable=True),
# sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False),
# sa.Column('end_transaction_id', sa.BigInteger(), nullable=True),
# sa.Column('operation_type', sa.SmallInteger(), nullable=False),
# sa.PrimaryKeyConstraint('id', 'transaction_id')
# )
# op.create_index(op.f('ix_bill_version_end_transaction_id'), 'bill_version', ['end_transaction_id'], unique=False)
# op.create_index(op.f('ix_bill_version_operation_type'), 'bill_version', ['operation_type'], unique=False)
# op.create_index(op.f('ix_bill_version_transaction_id'), 'bill_version', ['transaction_id'], unique=False)
# op.create_table('billowers_version',
# sa.Column('bill_id', sa.Integer(), autoincrement=False, nullable=False),
# sa.Column('person_id', sa.Integer(), autoincrement=False, nullable=False),
# sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False),
# sa.Column('end_transaction_id', sa.BigInteger(), nullable=True),
# sa.Column('operation_type', sa.SmallInteger(), nullable=False),
# sa.PrimaryKeyConstraint('bill_id', 'person_id', 'transaction_id')
# )
# op.create_index(op.f('ix_billowers_version_end_transaction_id'), 'billowers_version', ['end_transaction_id'], unique=False)
# op.create_index(op.f('ix_billowers_version_operation_type'), 'billowers_version', ['operation_type'], unique=False)
# op.create_index(op.f('ix_billowers_version_transaction_id'), 'billowers_version', ['transaction_id'], unique=False)
# op.create_table('person_version',
# sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
# sa.Column('project_id', sa.String(length=64), autoincrement=False, nullable=True),
# sa.Column('name', sa.UnicodeText(), autoincrement=False, nullable=True),
# sa.Column('weight', sa.Float(), autoincrement=False, nullable=True),
# sa.Column('activated', sa.Boolean(), autoincrement=False, nullable=True),
# sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False),
# sa.Column('end_transaction_id', sa.BigInteger(), nullable=True),
# sa.Column('operation_type', sa.SmallInteger(), nullable=False),
# sa.PrimaryKeyConstraint('id', 'transaction_id')
# )
# op.create_index(op.f('ix_person_version_end_transaction_id'), 'person_version', ['end_transaction_id'], unique=False)
# op.create_index(op.f('ix_person_version_operation_type'), 'person_version', ['operation_type'], unique=False)
# op.create_index(op.f('ix_person_version_transaction_id'), 'person_version', ['transaction_id'], unique=False)
# op.create_table('project',
# sa.Column('id', sa.String(length=64), nullable=False),
# sa.Column('name', sa.UnicodeText(), nullable=True),
# sa.Column('password', sa.String(length=128), nullable=True),
# sa.Column('contact_email', sa.String(length=128), nullable=True),
# sa.Column('logging_preference', sa.Enum('DISABLED', 'ENABLED', 'RECORD_IP', name='loggingmode'), server_default='ENABLED', nullable=False),
# sa.PrimaryKeyConstraint('id')
# )
# op.create_table('project_version',
# sa.Column('id', sa.String(length=64), autoincrement=False, nullable=False),
# sa.Column('name', sa.UnicodeText(), autoincrement=False, nullable=True),
# sa.Column('password', sa.String(length=128), autoincrement=False, nullable=True),
# sa.Column('contact_email', sa.String(length=128), autoincrement=False, nullable=True),
# sa.Column('logging_preference', sa.Enum('DISABLED', 'ENABLED', 'RECORD_IP', name='loggingmode'), server_default='ENABLED', autoincrement=False, nullable=True),
# sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False),
# sa.Column('end_transaction_id', sa.BigInteger(), nullable=True),
# sa.Column('operation_type', sa.SmallInteger(), nullable=False),
# sa.PrimaryKeyConstraint('id', 'transaction_id')
# )
# op.create_index(op.f('ix_project_version_end_transaction_id'), 'project_version', ['end_transaction_id'], unique=False)
# op.create_index(op.f('ix_project_version_operation_type'), 'project_version', ['operation_type'], unique=False)
# op.create_index(op.f('ix_project_version_transaction_id'), 'project_version', ['transaction_id'], unique=False)
# op.create_table('transaction',
# sa.Column('issued_at', sa.DateTime(), nullable=True),
# sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False),
# sa.Column('remote_addr', sa.String(length=50), nullable=True),
# sa.PrimaryKeyConstraint('id')
# )
# op.create_table('archive',
# sa.Column('id', sa.Integer(), nullable=False),
# sa.Column('project_id', sa.String(length=64), nullable=True),
# sa.Column('name', sa.UnicodeText(), nullable=True),
# sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
# sa.PrimaryKeyConstraint('id')
# )
# op.create_table('person',
# sa.Column('id', sa.Integer(), nullable=False),
# sa.Column('project_id', sa.String(length=64), nullable=True),
# sa.Column('name', sa.UnicodeText(), nullable=True),
# sa.Column('weight', sa.Float(), nullable=True),
# sa.Column('activated', sa.Boolean(), nullable=True),
# sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
# sa.PrimaryKeyConstraint('id'),
# sqlite_autoincrement=True
# )
# op.create_table('bill',
# sa.Column('id', sa.Integer(), nullable=False),
# sa.Column('payer_id', sa.Integer(), nullable=True),
# sa.Column('amount', sa.Float(), nullable=True),
# sa.Column('date', sa.Date(), nullable=True),
# sa.Column('creation_date', sa.Date(), nullable=True),
# sa.Column('what', sa.UnicodeText(), nullable=True),
# sa.Column('tag', sa.UnicodeText(), nullable=True),
# sa.Column('external_link', sa.UnicodeText(), nullable=True),
# sa.Column('archive', sa.Integer(), nullable=True),
# sa.ForeignKeyConstraint(['archive'], ['archive.id'], ),
# sa.ForeignKeyConstraint(['payer_id'], ['person.id'], ),
# sa.PrimaryKeyConstraint('id'),
# sqlite_autoincrement=True
# )
# op.create_table('billowers',
# sa.Column('bill_id', sa.Integer(), nullable=False),
# sa.Column('person_id', sa.Integer(), nullable=False),
# sa.ForeignKeyConstraint(['bill_id'], ['bill.id'], ),
# sa.ForeignKeyConstraint(['person_id'], ['person.id'], ),
# sa.PrimaryKeyConstraint('bill_id', 'person_id'),
# sqlite_autoincrement=True
# )
# op.drop_table('sqlite_sequence')
# # ### end Alembic commands ###


# def downgrade():
# # ### commands auto generated by Alembic - please adjust! ###
# op.create_table('sqlite_sequence',
# sa.Column('name', sa.NullType(), nullable=True),
# sa.Column('seq', sa.NullType(), nullable=True)
# )
# op.drop_table('billowers')
# op.drop_table('bill')
# op.drop_table('person')
# op.drop_table('archive')
# op.drop_table('transaction')
# op.drop_index(op.f('ix_project_version_transaction_id'), table_name='project_version')
# op.drop_index(op.f('ix_project_version_operation_type'), table_name='project_version')
# op.drop_index(op.f('ix_project_version_end_transaction_id'), table_name='project_version')
# op.drop_table('project_version')
# op.drop_table('project')
# op.drop_index(op.f('ix_person_version_transaction_id'), table_name='person_version')
# op.drop_index(op.f('ix_person_version_operation_type'), table_name='person_version')
# op.drop_index(op.f('ix_person_version_end_transaction_id'), table_name='person_version')
# op.drop_table('person_version')
# op.drop_index(op.f('ix_billowers_version_transaction_id'), table_name='billowers_version')
# op.drop_index(op.f('ix_billowers_version_operation_type'), table_name='billowers_version')
# op.drop_index(op.f('ix_billowers_version_end_transaction_id'), table_name='billowers_version')
# op.drop_table('billowers_version')
# op.drop_index(op.f('ix_bill_version_transaction_id'), table_name='bill_version')
# op.drop_index(op.f('ix_bill_version_operation_type'), table_name='bill_version')
# op.drop_index(op.f('ix_bill_version_end_transaction_id'), table_name='bill_version')
# op.drop_table('bill_version')
# # ### end Alembic commands ###

0 comments on commit 74e2bf2

Please sign in to comment.