Beispiel #1
0
def downgrade():
    op.create_table(
        'server_status',
        sa.Column('avg_process_sec',
                  sa.REAL(),
                  autoincrement=False,
                  nullable=True),
        sa.Column('avg_wait_sec',
                  sa.REAL(),
                  autoincrement=False,
                  nullable=True),
        sa.Column('date_created',
                  postgresql.TIMESTAMP(timezone=True),
                  autoincrement=False,
                  nullable=False),
        sa.Column('date_oldest_job_queued',
                  postgresql.TIMESTAMP(timezone=True),
                  autoincrement=False,
                  nullable=True),
        sa.Column('date_recently_completed',
                  postgresql.TIMESTAMP(timezone=True),
                  autoincrement=False,
                  nullable=True), sa.Column('id', sa.INTEGER(),
                                            nullable=False),
        sa.Column('processors_count',
                  sa.INTEGER(),
                  autoincrement=False,
                  nullable=True),
        sa.Column('waiting_job_count',
                  sa.INTEGER(),
                  autoincrement=False,
                  nullable=False),
        sa.PrimaryKeyConstraint('id', name=u'server_status_pkey'))
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('credits',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True),
    sa.Column('active', sa.BOOLEAN(), autoincrement=False, nullable=False),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='credits_pkey')
    )
    op.create_table('debits',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True),
    sa.Column('active', sa.BOOLEAN(), autoincrement=False, nullable=False),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='debits_pkey')
    )
    op.create_table('balances',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True),
    sa.Column('active', sa.BOOLEAN(), autoincrement=False, nullable=False),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='balances_pkey')
    )
Beispiel #3
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('device',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('cur_session', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_device_name'), 'device', ['name'], unique=True)
    op.create_table('log',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('device', sa.Integer(), nullable=True),
    sa.Column('session', sa.Integer(), nullable=True),
    sa.Column('bat_v', sa.REAL(), nullable=True),
    sa.Column('temp_f', sa.REAL(), nullable=True),
    sa.Column('light_vis', sa.REAL(), nullable=True),
    sa.Column('light_ir', sa.REAL(), nullable=True),
    sa.Column('light_uv', sa.REAL(), nullable=True),
    sa.Column('accel_x', sa.REAL(), nullable=True),
    sa.Column('accel_y', sa.REAL(), nullable=True),
    sa.Column('accel_z', sa.REAL(), nullable=True),
    sa.Column('tilt', sa.REAL(), nullable=True),
    sa.Column('wifi_conn_fail', sa.Integer(), nullable=True),
    sa.Column('mqtt_conn_fail', sa.Integer(), nullable=True),
    sa.Column('last_run_time', sa.REAL(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['device'], ['device.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_log_timestamp'), 'log', ['timestamp'], unique=False)
Beispiel #4
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'USER', type_='unique')
    op.alter_column('USER',
                    'password',
                    existing_type=sa.VARCHAR(length=60),
                    nullable=True)
    op.drop_constraint(None, 'TOUR', type_='unique')
    op.alter_column('TOUR',
                    'upload_time',
                    existing_type=postgresql.TIMESTAMP(),
                    nullable=False,
                    existing_server_default=sa.text('now()'))
    op.alter_column('TOUR',
                    'title',
                    existing_type=sa.VARCHAR(length=32),
                    nullable=False)
    op.alter_column('TOUR', 'rating', existing_type=sa.REAL(), nullable=False)
    op.alter_column('TOUR', 'price', existing_type=sa.REAL(), nullable=False)
    op.alter_column('TOUR',
                    'guide_id',
                    existing_type=sa.INTEGER(),
                    nullable=False)
    op.alter_column('TOUR',
                    'duration',
                    existing_type=postgresql.INTERVAL(),
                    nullable=False)
    op.create_index('LANGUAGE_pkey', 'LANGUAGE', ['id'], unique=True)
    op.drop_table('TOUR_DATE')
Beispiel #5
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('drugType', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('name', sa.String(length=50), nullable=False),
                    sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'account', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('accountNo', sa.String(length=50), nullable=False),
        sa.Column('time', sa.DateTime(), nullable=False),
        sa.Column('accountMoney', sa.REAL(), nullable=False),
        sa.Column('userId', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ['userId'],
            ['user.id'],
        ), sa.PrimaryKeyConstraint('id'))
    op.create_table('drug', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('num', sa.String(length=50), nullable=False),
                    sa.Column('name', sa.String(length=50), nullable=False),
                    sa.Column('count', sa.Integer(), nullable=False),
                    sa.Column('saleCount', sa.Integer(), nullable=False),
                    sa.Column('price', sa.REAL(), nullable=False),
                    sa.Column('desc', sa.String(length=500), nullable=False),
                    sa.Column('drugTypeId', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['drugTypeId'],
                        ['drugType.id'],
                    ), sa.PrimaryKeyConstraint('id'))
    op.create_table('sale', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('time', sa.DateTime(), nullable=False),
                    sa.Column('saleCount', sa.Integer(), nullable=False),
                    sa.Column('saleMoney', sa.REAL(), nullable=False),
                    sa.Column('userId', sa.Integer(), nullable=True),
                    sa.Column('accountId', sa.Integer(), nullable=True),
                    sa.Column('drugId', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['accountId'],
                        ['account.id'],
                    ), sa.ForeignKeyConstraint(
                        ['drugId'],
                        ['drug.id'],
                    ), sa.ForeignKeyConstraint(
                        ['userId'],
                        ['user.id'],
                    ), sa.PrimaryKeyConstraint('id'))
    op.create_table('stock', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('stockDate', sa.DateTime(), nullable=False),
                    sa.Column('stockPrice', sa.REAL(), nullable=False),
                    sa.Column('stockCount', sa.Integer(), nullable=False),
                    sa.Column('stockMoney', sa.REAL(), nullable=False),
                    sa.Column('drugId', sa.Integer(), nullable=True),
                    sa.Column('userId', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['drugId'],
                        ['drug.id'],
                    ), sa.ForeignKeyConstraint(
                        ['userId'],
                        ['user.id'],
                    ), sa.PrimaryKeyConstraint('id'))
def upgrade():
    op.add_column(
        "comment_tags",
        sa.Column("weight",
                  sa.REAL(),
                  server_default=sa.text("1.0"),
                  nullable=False),
    )
    op.add_column("users",
                  sa.Column("comment_tag_weight", sa.REAL(), nullable=True))
Beispiel #7
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Environemnt', sa.Column('id',
                                             sa.INTEGER(),
                                             nullable=False),
                    sa.Column('timestamp', sa.TIMESTAMP(), nullable=True),
                    sa.Column('temperature', sa.REAL(), nullable=True),
                    sa.Column('humidity', sa.REAL(), nullable=True),
                    sa.PrimaryKeyConstraint('id'))
    op.drop_table('environment')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('items', sa.Column('wholesale_price', sa.REAL(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('exp_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('item_code', sa.INTEGER(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('mfd_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('retail_price', sa.REAL(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('qty', sa.INTEGER(), autoincrement=False, nullable=False))
    op.add_column('items', sa.Column('discount', sa.REAL(), autoincrement=False, nullable=True))
    op.drop_table('stock')
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('group',
    sa.Column('group_id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=30), nullable=False),
    sa.PrimaryKeyConstraint('group_id')
    )
    op.create_table('user',
    sa.Column('user_id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('username', sa.String(length=20), nullable=False),
    sa.Column('pw_hash', sa.String(length=64), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('username')
    )
    op.create_table('expense',
    sa.Column('expense_id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(length=50), nullable=True),
    sa.Column('total', sa.REAL(), nullable=False),
    sa.Column('payer', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=True),
    sa.Column('split', sa.Enum('EQUAL', 'EXACT', 'PERCENTAGE', name='splittype'), nullable=False),
    sa.Column('timestamp', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.ForeignKeyConstraint(['group_id'], ['group.group_id'], ),
    sa.ForeignKeyConstraint(['payer'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('expense_id')
    )
    op.create_table('group_membership',
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['group_id'], ['group.group_id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('group_id', 'user_id')
    )
    op.create_table('payment',
    sa.Column('payment_id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('note', sa.String(length=50), nullable=True),
    sa.Column('amount', sa.REAL(), nullable=False),
    sa.Column('payer', sa.Integer(), nullable=False),
    sa.Column('payee', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=True),
    sa.Column('timestamp', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.ForeignKeyConstraint(['group_id'], ['group.group_id'], ),
    sa.ForeignKeyConstraint(['payee'], ['user.user_id'], ),
    sa.ForeignKeyConstraint(['payer'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('payment_id')
    )
    op.create_table('expense_share',
    sa.Column('expense_id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('share', sa.REAL(), nullable=False),
    sa.ForeignKeyConstraint(['expense_id'], ['expense.expense_id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('expense_id', 'user_id')
    )
Beispiel #10
0
class Session(Base):
    __tablename__ = "session"
    session_id = sa.Column(sa.Integer, primary_key=True)
    start_time = sa.Column(sa.TIMESTAMP(timezone=True), unique=True)
    datasource = sa.Column(sa.String())
    author = sa.Column(sa.String())
    file_version = sa.Column(sa.REAL())
    title = sa.Column(sa.String())
    lat = sa.Column(sa.REAL())
    lon = sa.Column(sa.REAL())
    client_version = sa.Column(sa.String())
    status = sa.Column(sa.String())
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('appliance_type',
                  sa.Column('max_power', sa.REAL(), nullable=True))
    op.add_column('appliance_type',
                  sa.Column('min_off_duration', sa.REAL(), nullable=True))
    op.add_column('appliance_type',
                  sa.Column('min_on_duration', sa.REAL(), nullable=True))
    op.add_column('appliance_type',
                  sa.Column('on_power_threshold', sa.REAL(), nullable=True))
    op.drop_index('sample_power_source_id_timestamp_physical_quantity_id_idx',
                  table_name='sample')
Beispiel #12
0
class Impact(Base):
    __tablename__ = "impact"
    id = sa.Column(sa.Integer, primary_key=True)
    session_id = sa.Column(
        sa.INTEGER(),
        sa.ForeignKey("session.session_id", ondelete="CASCADE"),
        index=True,
    )
    killer = sa.Column(sa.INTEGER(), sa.ForeignKey("object.id"))
    target = sa.Column(sa.INTEGER(), sa.ForeignKey("object.id"))
    weapon = sa.Column(sa.INTEGER(), sa.ForeignKey("object.id"))
    time_offset = sa.Column(sa.REAL())
    impact_dist = sa.Column(sa.REAL(), index=True)
Beispiel #13
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'TOUR_DATE',
        sa.Column('id',
                  sa.Integer(),
                  server_default=FetchedValue(),
                  nullable=False),
        sa.Column('tour_id', sa.Integer(), nullable=True),
        sa.Column('tour_date',
                  sa.DateTime(),
                  server_default=FetchedValue(),
                  nullable=True),
        sa.ForeignKeyConstraint(
            ['tour_id'],
            ['TOUR.id'],
        ), sa.PrimaryKeyConstraint('id'))
    op.drop_index('LANGUAGE_pkey', table_name='LANGUAGE')
    op.alter_column('TOUR',
                    'duration',
                    existing_type=postgresql.INTERVAL(),
                    nullable=True)
    op.alter_column('TOUR',
                    'guide_id',
                    existing_type=sa.INTEGER(),
                    nullable=True)
    op.alter_column('TOUR', 'price', existing_type=sa.REAL(), nullable=True)
    op.alter_column('TOUR', 'rating', existing_type=sa.REAL(), nullable=True)
    op.alter_column('TOUR',
                    'title',
                    existing_type=sa.VARCHAR(length=32),
                    nullable=True)
    op.alter_column('TOUR',
                    'upload_time',
                    existing_type=postgresql.TIMESTAMP(),
                    nullable=True,
                    existing_server_default=sa.text('now()'))
    op.create_unique_constraint(None, 'TOUR', ['uuid'])
    op.alter_column('USER',
                    'email',
                    existing_type=sa.VARCHAR(length=60),
                    nullable=True)
    op.alter_column('USER',
                    'firstname',
                    existing_type=sa.VARCHAR(length=32),
                    nullable=True)
    op.alter_column('USER',
                    'lastname',
                    existing_type=sa.VARCHAR(length=32),
                    nullable=True)
    op.create_unique_constraint(None, 'USER', ['uuid'])
Beispiel #14
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('statusdb',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('sitename', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('sectionname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('statustext', sa.TEXT(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='statusdb_pkey'),
    sa.UniqueConstraint('sitename', 'sectionname', name='statusdb_sitename_sectionname_key')
    )
    op.create_table('retrieved_pages',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('sitename', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('artistname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('pageurl', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('retreivaltime', sa.REAL(), autoincrement=False, nullable=False),
    sa.Column('downloadpath', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('itempagecontent', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('itempagetitle', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('seqnum', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='retrieved_pages_pkey'),
    sa.UniqueConstraint('sitename', 'artistname', 'pageurl', 'seqnum', name='retrieved_pages_sitename_artistname_pageurl_seqnum_key')
    )
    op.create_table('retreival_times',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('sitename', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('artistname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('retreivaltime', sa.REAL(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='retreival_times_pkey'),
    sa.UniqueConstraint('sitename', 'artistname', name='retreival_times_sitename_artistname_key')
    )
    op.create_table('siteartistnames',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('sitename', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('artistname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('uploadeh', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
    sa.Column('last_fetched', postgresql.DOUBLE_PRECISION(precision=53), server_default=sa.text('0'), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='siteartistnames_pkey'),
    sa.UniqueConstraint('sitename', 'artistname', name='siteartistnames_sitename_artistname_key')
    )
    op.create_table('errored_pages',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('sitename', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('artistname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('pageurl', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('retreivaltime', sa.REAL(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='errored_pages_pkey'),
    sa.UniqueConstraint('sitename', 'artistname', 'pageurl', name='errored_pages_sitename_artistname_pageurl_key')
    )
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('sps_camera', 'sps_module_name')
    op.drop_column('sps_camera', 'sps_camera_name')
    op.alter_column('agc_data', 'image_moment_00_pix',
                    existing_type=sa.REAL(),
                    comment=None,
                    existing_comment='',
                    existing_nullable=True)
    op.create_table('test',
                    sa.Column('id', sa.INTEGER(), autoincrement=False, nullable=True),
                    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True)
                    )
    op.drop_table('iic_sequence_status')
    op.drop_table('iic_sequence')
Beispiel #16
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('item',
    sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('app.item_id_seq'::regclass)"), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('name', sa.CHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('code', sa.CHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('price', sa.REAL(), autoincrement=False, nullable=True),
    sa.Column('count', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('image', sa.CHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('measure', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('ball', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('nds', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('sale', sa.CHAR(length=1), autoincrement=False, nullable=True),
    sa.Column('cat', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('office', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('desc', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('sect', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('test', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('modif', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='item_pkey'),
    schema='app'
    )
    op.drop_table('product', schema='app')
Beispiel #17
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('substance', 'unit',
               existing_type=sa.VARCHAR(length=16),
               nullable=False)
    op.alter_column('substance', 'title',
               existing_type=sa.VARCHAR(length=255),
               nullable=False)
    op.alter_column('substance', 'sort',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('substance', 'precision',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('substance', 'hard_ref',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('substance', 'criteria',
               existing_type=sa.REAL(),
               nullable=False)
    op.alter_column('substance', 'cas',
               existing_type=sa.VARCHAR(length=255),
               nullable=False)
    op.alter_column('substance', 'active',
               existing_type=sa.BOOLEAN(),
               nullable=False)
    op.drop_column('substance', 'cas_sanitized')
    op.alter_column('criteria', 'state_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('criteria', 'active',
               existing_type=sa.BOOLEAN(),
               nullable=False)
Beispiel #18
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'bid_document', sa.Column('created_at', sa.DateTime(), nullable=False),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('deleted_at', sa.DateTime(), nullable=True),
        sa.Column('public_id', sa.String(length=100), nullable=False),
        sa.Column('status', sa.Integer(), nullable=False),
        sa.Column('deletion_marker', sa.Integer(), nullable=True),
        sa.Column('created_by', sa.String(length=200), nullable=True),
        sa.Column('updated_by', sa.String(length=200), nullable=True),
        sa.Column('deleted_by', sa.String(length=200), nullable=True),
        sa.Column('bid_id', sa.String(length=100), nullable=False),
        sa.Column('doc_type', sa.String(length=100), nullable=True),
        sa.Column('doc_url', sa.String(length=100), nullable=False),
        sa.ForeignKeyConstraint(
            ['bid_id'],
            ['bid.public_id'],
        ), sa.PrimaryKeyConstraint('public_id'))
    op.create_index(op.f('ix_bid_document_created_by'),
                    'bid_document', ['created_by'],
                    unique=False)
    op.create_index(op.f('ix_bid_document_deleted_by'),
                    'bid_document', ['deleted_by'],
                    unique=False)
    op.create_index(op.f('ix_bid_document_updated_by'),
                    'bid_document', ['updated_by'],
                    unique=False)
    op.alter_column('bid', 'amount', existing_type=sa.REAL(), nullable=True)
Beispiel #19
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('galaxy',
                  sa.Column('bands', sa.String(length=64), nullable=True))
    op.add_column('galaxy', sa.Column('fov', sa.REAL(), nullable=True))
    op.create_index(op.f('ix_galaxy_bands'), 'galaxy', ['bands'], unique=False)
    op.create_index(op.f('ix_galaxy_fov'), 'galaxy', ['fov'], unique=False)
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('product',
                    'price',
                    existing_type=sa.Float(precision=2),
                    type_=sa.REAL(),
                    existing_nullable=True)
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'mcs_pfi_transformation', type_='unique')
    op.drop_constraint(None, 'cobra_target', type_='unique')
    op.drop_constraint(None, 'cobra_match', type_='unique')
    op.drop_constraint(None, 'agc_exposure', type_='unique')
    op.drop_constraint(None, 'agc_data', type_='unique')
    op.alter_column('agc_data', 'image_moment_00_pix',
                    existing_type=sa.REAL(),
                    comment=None,
                    existing_comment='',
                    existing_nullable=True)
    op.create_table('test',
                    sa.Column('id', sa.INTEGER(), autoincrement=False, nullable=True),
                    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True)
                    )
Beispiel #22
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "rate",
        sa.Column("rateid",
                  postgresql.UUID(),
                  autoincrement=False,
                  nullable=False),
        sa.Column("stars", sa.REAL(), autoincrement=False, nullable=False),
        sa.Column("review", sa.TEXT(), autoincrement=False, nullable=False),
        sa.Column("report", sa.BOOLEAN(), autoincrement=False, nullable=True),
        sa.Column("reviewed", sa.TEXT(), autoincrement=False, nullable=False),
        sa.Column("reviewer", sa.TEXT(), autoincrement=False, nullable=False),
        sa.CheckConstraint(
            "reviewed ~* '^[\\w\\-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$'::text",
            name="valid_reviewed_email",
        ),
        sa.CheckConstraint(
            "reviewer ~* '^[\\w\\-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$'::text",
            name="valid_reviewer_email",
        ),
        sa.CheckConstraint(
            "(stars >= (0)::double precision) AND (stars <= (5)::double precision)",
            name="valid_stars",
        ),
        sa.CheckConstraint("reviewed <> reviewer", name="valid_lender_user"),
        sa.PrimaryKeyConstraint("rateid", name="rate_pk"),
    )
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('hotel',
                    'site_id',
                    existing_type=sa.INTEGER(),
                    nullable=True)
    op.alter_column('hotel',
                    'estrelas',
                    existing_type=sa.Float(precision=1),
                    type_=sa.REAL(),
                    existing_nullable=False)
    op.alter_column('hotel',
                    'diaria',
                    existing_type=sa.Float(precision=2),
                    type_=sa.REAL(),
                    existing_nullable=False)
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('price_history', sa.Column('open', sa.REAL(), autoincrement=False, nullable=True))
    op.add_column('price_history', sa.Column('low', sa.REAL(), autoincrement=False, nullable=True))
    op.add_column('price_history', sa.Column('high', sa.REAL(), autoincrement=False, nullable=True))
    op.add_column('price_history', sa.Column('close', sa.REAL(), autoincrement=False, nullable=True))
    op.add_column('price_history', sa.Column('adj close', sa.REAL(), autoincrement=False, nullable=True))
    op.drop_column('price_history', 'value')
    op.drop_column('price_history', 'action')
    op.create_unique_constraint('fiscal_year_unique', 'ms_financials', ['ticker', 'exchange', 'fiscal_year', 'period'])
    op.create_table('migrate_version',
    sa.Column('repository_id', sa.VARCHAR(length=250), autoincrement=False, nullable=False),
    sa.Column('repository_path', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('version', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('repository_id', name='migrate_version_pkey')
    )
Beispiel #25
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('product',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('name', sa.CHAR(length=255), nullable=True),
    sa.Column('code', sa.CHAR(length=255), nullable=True),
    sa.Column('price', sa.REAL(), nullable=True),
    sa.Column('count', sa.Integer(), nullable=True),
    sa.Column('image', sa.CHAR(length=255), nullable=True),
    sa.Column('measure', sa.Integer(), nullable=True),
    sa.Column('ball', sa.Integer(), nullable=True),
    sa.Column('nds', sa.Integer(), nullable=True),
    sa.Column('sale', sa.CHAR(length=1), nullable=True),
    sa.Column('cat', sa.Integer(), nullable=True),
    sa.Column('office', sa.Integer(), nullable=True),
    sa.Column('desc', sa.Text(), nullable=True),
    sa.Column('sect', sa.Integer(), nullable=True),
    sa.Column('test', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('modif', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    schema='app'
    )
    op.drop_table('item', schema='app')
Beispiel #26
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'savings_goals',
        sa.Column('current_savings',
                  sa.REAL(),
                  autoincrement=False,
                  nullable=True))
Beispiel #27
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('bills', sa.Column('name', sa.VARCHAR(length=20), autoincrement=False, nullable=False))
    op.add_column('bills', sa.Column('amount', sa.REAL(), autoincrement=False, nullable=False))
    op.add_column('bills', sa.Column('due_date', sa.DATE(), autoincrement=False, nullable=True))
    op.drop_column('bills', 'bill_name')
    op.drop_column('bills', 'bill_due_date')
    op.drop_column('bills', 'bill_amount')
Beispiel #28
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'debtor',
        sa.Column('interest_rate',
                  sa.REAL(),
                  autoincrement=False,
                  nullable=False))
Beispiel #29
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'savings_entry',
        sa.Column('id', postgresql.UUID(), autoincrement=False,
                  nullable=False),
        sa.Column('savings_date',
                  sa.DATE(),
                  autoincrement=False,
                  nullable=False),
        sa.Column('transaction_type',
                  sa.VARCHAR(length=10),
                  autoincrement=False,
                  nullable=False),
        sa.Column('amount', sa.REAL(), autoincrement=False, nullable=False),
        sa.Column('user_id',
                  postgresql.UUID(),
                  autoincrement=False,
                  nullable=True),
        sa.Column('total', sa.REAL(), autoincrement=False, nullable=True),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'],
                                name='savings_entry_user_id_fkey'),
        sa.PrimaryKeyConstraint('id', name='savings_entry_pkey'))
    op.create_table(
        'savings_goal',
        sa.Column('id', postgresql.UUID(), autoincrement=False,
                  nullable=False),
        sa.Column('start_date', sa.DATE(), autoincrement=False,
                  nullable=False),
        sa.Column('end_date', sa.DATE(), autoincrement=False, nullable=False),
        sa.Column('amount', sa.REAL(), autoincrement=False, nullable=False),
        sa.Column('user_id',
                  postgresql.UUID(),
                  autoincrement=False,
                  nullable=True),
        sa.Column('previous_amount',
                  sa.REAL(),
                  autoincrement=False,
                  nullable=True),
        sa.ForeignKeyConstraint(['user_id'], ['users.id'],
                                name='savings_goal_user_id_fkey'),
        sa.PrimaryKeyConstraint('id', name='savings_goal_pkey'))
    op.drop_table('savings_goals')
    op.drop_table('total_savings_log')
    op.drop_table('savings_entries')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('mcs_exposure', 'version_instdata')
    op.drop_column('mcs_exposure', 'version_actor')
    op.drop_column('mcs_exposure', 'measurement_algorithm')
    op.drop_column('agc_exposure', 'version_instdata')
    op.drop_column('agc_exposure', 'version_actor')
    op.drop_column('agc_exposure', 'measurement_algorithm')
    op.alter_column('agc_data', 'image_moment_00_pix',
                    existing_type=sa.REAL(),
                    comment=None,
                    existing_comment='',
                    existing_nullable=True)
    op.create_table('test',
                    sa.Column('id', sa.INTEGER(), autoincrement=False, nullable=True),
                    sa.Column('value', sa.REAL(), autoincrement=False, nullable=True)
                    )
    op.drop_table('agc_guide_offset')