Exemple #1
0
def downgrade():
    op.alter_column('users',
                    'provider',
                    existing_type=mysql.ENUM('google', 'facebook', 'twitter',
                                             'stockbets'),
                    nullable=False,
                    type_=mysql.ENUM('google', 'facebook', 'twitter'))

    op.alter_column('users',
                    'email',
                    existing_type=sa.VARCHAR(length=255),
                    type_=sa.Text,
                    existing_nullable=True)
    op.alter_column('users',
                    'name',
                    existing_type=sa.VARCHAR(length=255),
                    type_=sa.Text,
                    existing_nullable=True)
    op.alter_column('users',
                    'username',
                    existing_type=sa.VARCHAR(length=255),
                    type_=sa.Text,
                    existing_nullable=True)
    op.alter_column('users',
                    'resource_uuid',
                    existing_type=sa.VARCHAR(length=255),
                    type_=sa.Text,
                    existing_nullable=True)

    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_index(op.f('ix_users_resource_uuid'), table_name='users')
    op.drop_index(op.f('ix_users_name'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_column('users', 'password')
Exemple #2
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "transaction_item",
        "item_type",
        existing_type=sa.Enum(u"Ticket", u"Generic", u"Postage", u"AdminFee"),
        type_=mysql.ENUM(u"Ticket", u"Generic", u"Postage"),
        existing_nullable=False,
    )
    op.alter_column(
        "statistic",
        "group",
        existing_type=sa.Enum(
            u"college_users",
            u"total_ticket_sales",
            u"guest_ticket_sales",
            u"ticket_types",
            u"payment_methods",
            u"waiting",
            u"dietary_requirements",
        ),
        type_=mysql.ENUM(
            u"college_users",
            u"payment_methods",
            u"ticket_types",
            u"total_ticket_sales",
            u"guest_ticket_sales",
            u"waiting",
        ),
        existing_nullable=False,
    )
Exemple #3
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'results', sa.Column('cooking_type', mysql.ENUM(u'Unknown', u'Gas', u'Electricity', u'Other'), nullable=True))
    op.add_column(u'results', sa.Column('water_heating_type', mysql.ENUM(u'Unknown', u'Gas', u'Electricity', u'Solar', u'Shared/municipal', u'Heat pump', u'Other'), nullable=True))
    op.add_column(u'results', sa.Column('occupation_type', mysql.ENUM(u'Owned', u'Rented privately', u'Rented council', u'Rented housing association', u'Other'), nullable=True))
    op.add_column(u'results', sa.Column('building_type', mysql.ENUM(u'Flat', u'Maisonette', u'Mid terrace', u'End terrace', u'Semi-detatched', u'Detatched', u'Other'), nullable=True))
    op.add_column(u'results', sa.Column('primary_heating_type', mysql.VARCHAR(length=150), nullable=True))
    op.add_column(u'results', sa.Column('secondary_heating_type', mysql.VARCHAR(length=150), nullable=True))
    op.add_column(u'results', sa.Column('wall_construction', mysql.ENUM(u'Solid brick', u'Insulated cavity', u'Uninsulated cavity', u'Stone', u'Timber', u'Other'), nullable=True))
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_constraint(None, 'results', type_='foreignkey')
    op.drop_column(u'results', 'water_heating_type_id')
    op.drop_column(u'results', 'wall_construction_type_id')
    op.drop_column(u'results', 'secondary_heating_type_id')
    op.drop_column(u'results', 'primary_heating_type_id')
    op.drop_column(u'results', 'occupation_type_id')
    op.drop_column(u'results', 'cooking_type_id')
    op.drop_column(u'results', 'building_type_id')
    op.drop_table('water_heating_types')
    op.drop_table('wards')
    op.drop_table('wall_construction_types')
    op.drop_table('space_heating_types')
    op.drop_table('occupation_types')
    op.drop_table('cooking_types')
    op.drop_table('building_types')
Exemple #4
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        u'thermal_image',
        sa.Column('building_type',
                  mysql.ENUM(u'Flat', u'Maisonette', u'Mid terrace',
                             u'End terrace', u'Semi-detatched', u'Detatched',
                             u'Other'),
                  nullable=True))
    op.drop_constraint(None, 'thermal_image', type_='foreignkey')
    op.drop_column(u'thermal_image', 'building_type_id')
    op.add_column(
        u'surveys',
        sa.Column('building_type',
                  mysql.ENUM(u'Flat', u'Maisonette', u'Mid terrace',
                             u'End terrace', u'Semi-detatched', u'Detatched',
                             u'Other'),
                  nullable=True))
    op.add_column(
        u'surveys',
        sa.Column('lead_status',
                  mysql.ENUM(u'Possible', u'Successful', u'Dead'),
                  nullable=True))
    op.add_column(u'surveys',
                  sa.Column('ward', mysql.VARCHAR(length=50), nullable=True))
    op.drop_constraint(None, 'surveys', type_='foreignkey')
    op.drop_constraint(None, 'surveys', type_='foreignkey')
    op.drop_constraint(None, 'surveys', type_='foreignkey')
    op.drop_column(u'surveys', 'ward_id')
    op.drop_column(u'surveys', 'lead_status_id')
    op.drop_column(u'surveys', 'building_type_id')
    op.drop_table('survey_lead_statuses')
Exemple #5
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('producto',
                    'foto',
                    existing_type=mysql.VARCHAR(length=50),
                    nullable=True)
    op.drop_column('producto', 'etiqueta_uno')
    op.drop_column('producto', 'etiqueta_tres')
    op.drop_column('producto', 'etiqueta_dos')
    op.create_table('feeling',
                    sa.Column('id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=True,
                              nullable=False),
                    sa.Column('as_felt_before',
                              mysql.ENUM('SADDER', 'SAD', 'INDIFFERENT',
                                         'HAPPY', 'HAPPIER'),
                              nullable=False),
                    sa.Column('as_felt_afterwards',
                              mysql.ENUM('SADDER', 'SAD', 'INDIFFERENT',
                                         'HAPPY', 'HAPPIER'),
                              nullable=False),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset='utf8mb4',
                    mysql_engine='InnoDB')
Exemple #6
0
class User(BASE):
    __tablename__ = "users_main"
    id = Column("ID", mysql.INTEGER(10, unsigned=True), primary_key=True)
    username = Column('Username', mysql.VARCHAR(20))
    email = Column('Email', mysql.VARCHAR(255))
    pass_hash = Column('PassHash', mysql.VARCHAR(60))
    secret = Column('Secret', mysql.VARCHAR(32))
    irc_key = Column('IRCKey', mysql.CHAR(32))
    last_login = Column('LastLogin', mysql.DATETIME)
    last_access = Column('LastAccess', mysql.DATETIME)
    ip = Column('IP', mysql.VARCHAR(15))
    class_id = Column('Class', mysql.TINYINT(2))
    uploaded = Column('Uploaded', mysql.BIGINT(20, unsigned=True))
    downloaded = Column('Downloaded', mysql.BIGINT(20, unsigned=True))
    title = Column('Title', mysql.TEXT)
    enabled = Column('Enabled', mysql.ENUM('0', '1', '2'))
    paranoia = Column('Paranoia', mysql.TEXT)
    visible = Column('Visible', mysql.ENUM('1', '0'))
    invites = Column('Invites', mysql.INTEGER(10, unsigned=True))
    permission_id = Column('PermissionID', mysql.INTEGER(10, unsigned=True),
                           ForeignKey('permissions.ID'))
    custom_permissions = Column('CustomPermissions', mysql.TEXT)
    can_leech = Column('can_leech', mysql.TINYINT(4))
    torrent_pass = Column('torrent_pass', mysql.CHAR(32))
    required_ratio = Column('RequiredRatio', mysql.DOUBLE(10, 8))
    required_ratio_work = Column('RequiredRatioWork', mysql.DOUBLE(10, 8))
    ipcc = Column('ipcc', mysql.VARCHAR(2))
    fl_tokens = Column('FLTokens', mysql.INTEGER(10))

    permission_class = relationship("Permissions")

    info = relationship("UsersInfo")

    def get_paranoia(self):
        return dict_to_list(unserialize(bytes(str(self.paranoia), 'utf-8')))
Exemple #7
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('ibm_instance_profiles',
                    'family',
                    existing_type=mysql.ENUM('BALANCED', 'CPU', 'MEMORY'),
                    type_=mysql.ENUM('BALANCED', 'COMPUTE', 'MEMORY', "GPU"),
                    existing_nullable=True)
Exemple #8
0
class outbox_multipart(Base):
    __tablename__ = 'outbox_multipart'
    Text = Column(TEXT)
    Coding = Column(mysql.ENUM('Default_No_Compression',
                               'Unicode_No_Compression', '8bit',
                               'Default_Compression', 'Unicode_Compression'),
                    nullable=False,
                    server_default='Default_No_Compression')
    UDH = Column(TEXT)
    Class = Column(Integer, server_default='-1')
    TextDecoded = Column(TEXT)
    ID = Column(INTEGER(unsigned=True),
                nullable=False,
                primary_key=True,
                server_default='0')
    SequencePosition = Column(Integer,
                              nullable=False,
                              primary_key=True,
                              server_default="1")
    Status = Column(mysql.ENUM('SendingOK', 'SendingOKNoReport',
                               'SendingError', 'DeliveryOK', 'DeliveryFailed',
                               'DeliveryPending', 'DeliveryUnknown', 'Error',
                               'Reserved'),
                    nullable=False,
                    server_default='Reserved')
    StatusCode = Column(Integer, nullable=False, server_default="-1")
    __table_args__ = {'mysql_engine': 'MyISAM', 'mysql_charset': 'utf8mb4'}
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'tallySheetVersionRow_CE_201_PV',
        sa.Column('tallySheetVersionRowId', sa.Integer(), nullable=False),
        sa.Column('tallySheetVersionId', sa.Integer(), nullable=True),
        sa.Column('ballotBoxStationaryItemId', sa.Integer(), nullable=False),
        sa.Column('numberOfPacketsInserted', sa.Integer(), nullable=False),
        sa.Column('numberOfAPacketsFound', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ['tallySheetVersionId'],
            ['tallySheetVersion.tallySheetVersionId'],
        ), sa.PrimaryKeyConstraint('tallySheetVersionRowId'),
        sa.UniqueConstraint('tallySheetVersionId',
                            'ballotBoxStationaryItemId',
                            name='BallotBoxPerCE201PV'))
    op.create_table(
        'tallySheetVersionRow_CE_201_PV_CC',
        sa.Column('tallySheetVersionRowId', sa.Integer(), nullable=False),
        sa.Column('tallySheetVersionId', sa.Integer(), nullable=True),
        sa.Column('countingCentreId', sa.Integer(), nullable=True),
        sa.Column('situation', sa.String(100), nullable=False),
        sa.Column('timeOfCommencementOfCount', sa.DateTime(), nullable=False),
        sa.Column('numberOfAPacketsFound', sa.Integer(), nullable=False),
        sa.Column('numberOfACoversRejected', sa.Integer(), nullable=False),
        sa.Column('numberOfBCoversRejected', sa.Integer(), nullable=False),
        sa.Column('numberOfValidBallotPapers', sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ['countingCentreId'],
            ['area.areaId'],
        ),
        sa.ForeignKeyConstraint(
            ['tallySheetVersionId'],
            ['tallySheetVersion.tallySheetVersionId'],
        ), sa.PrimaryKeyConstraint('tallySheetVersionRowId'),
        sa.UniqueConstraint('tallySheetVersionId',
                            'countingCentreId',
                            name='CountingCenterPerCE201PVCC'))

    op.alter_column('tallySheet',
                    'tallySheetCode',
                    existing_type=mysql.ENUM(
                        'CE_201', 'CE_201_PV', 'PRE_28', 'PRE_41', 'PRE_30_PD',
                        'PRE_30_ED', 'PRE_21', 'PRE_34_CO', 'PRE_34_I_RO',
                        'PRE_34_II_RO', 'PRE_34_RO',
                        'PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS',
                        'PRE_ALL_ISLAND_RESULTS'),
                    nullable=False)

    op.alter_column('tallySheetVersion',
                    'tallySheetVersionCode',
                    existing_type=mysql.ENUM(
                        'CE_201', 'CE_201_PV', 'PRE_28', 'PRE_41', 'PRE_30_PD',
                        'PRE_30_ED', 'PRE_21', 'PRE_34_CO', 'PRE_34_I_RO',
                        'PRE_34_II_RO', 'PRE_34_RO',
                        'PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS',
                        'PRE_ALL_ISLAND_RESULTS'),
                    nullable=False)
Exemple #10
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('ibm_ipsec_policy',
                    'encryption_algorithm',
                    existing_type=sa.Enum('triple_des', 'aes128', 'aes256'),
                    type_=mysql.ENUM('3des', 'aes128', 'aes256'),
                    existing_nullable=False)
    op.alter_column('ibm_ike_policy',
                    'encryption_algorithm',
                    existing_type=sa.Enum('triple_des', 'aes128', 'aes256'),
                    type_=mysql.ENUM('3des', 'aes128', 'aes256'),
                    existing_nullable=True)
Exemple #11
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('ibm_instances_tasks',
                    'image_location',
                    existing_type=mysql.ENUM('classical_vsi',
                                             'classical_image', 'cos_vhd',
                                             'cos_vmdk', 'cos_qcow2',
                                             'custom_image', 'public_image'),
                    type_=mysql.ENUM('classical_vsi', 'classical_image',
                                     'cos_vhd', 'cos_qcow2', 'custom_image',
                                     'public_image'),
                    nullable=False)
Exemple #12
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('auth_tokens',
                    sa.Column('id', mysql.VARCHAR(length=32), nullable=False),
                    sa.Column('expire_at', mysql.DATETIME(), nullable=False),
                    sa.Column('attempts',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('token_type',
                              mysql.ENUM('PIN', 'ACCESS', 'REFRESH'),
                              nullable=False),
                    sa.Column('is_black_listed',
                              mysql.TINYINT(display_width=1),
                              autoincrement=False,
                              nullable=False),
                    sa.Column('data', mysql.JSON(), nullable=False),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset='latin1',
                    mysql_engine='InnoDB')
    op.create_table('ibm_tokens',
                    sa.Column('id', mysql.VARCHAR(length=40), nullable=False),
                    sa.Column('user_id',
                              mysql.VARCHAR(length=32),
                              nullable=False),
                    sa.ForeignKeyConstraint(['user_id'], ['users.id'],
                                            name='ibm_tokens_ibfk_1'),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset='latin1',
                    mysql_engine='InnoDB')
    op.create_table('devices',
                    sa.Column('id', mysql.VARCHAR(length=100), nullable=False),
                    sa.Column('finger_print',
                              mysql.VARCHAR(length=100),
                              nullable=False),
                    sa.Column('registered_at',
                              mysql.DATETIME(),
                              nullable=False),
                    sa.Column('device_info', mysql.JSON(), nullable=False),
                    sa.Column('session_token',
                              mysql.VARCHAR(length=32),
                              nullable=True),
                    sa.Column('status',
                              mysql.ENUM('trusted', 'untrusted'),
                              nullable=False),
                    sa.Column('user_id',
                              mysql.VARCHAR(length=32),
                              nullable=False),
                    sa.ForeignKeyConstraint(['user_id'], ['users.id'],
                                            name='devices_ibfk_1'),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset='latin1',
                    mysql_engine='InnoDB')
Exemple #13
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('meal',
                    'time',
                    existing_type=mysql.ENUM(u'morning', u'lunch', u'dinner'),
                    nullable=True)
    op.alter_column('meal',
                    'category',
                    existing_type=mysql.ENUM(u'noodle', u'salad', u'takeout',
                                             u'korean', u'western', u'dinner',
                                             u'dinner-noodle'),
                    nullable=True)
def downgrade():
    op.alter_column('tallySheet', 'tallySheetCode',
                    existing_type=mysql.ENUM('CE_201', 'CE_201_PV', 'PRE_28', 'PRE_41', 'PRE_30_PD', 'PRE_30_ED',
                                             'PRE_21', 'PRE_34_CO', 'PRE_34_I_RO', 'PRE_34_II_RO', 'PRE_34_RO',
                                             'PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS', 'PRE_ALL_ISLAND_RESULTS'),
                    nullable=False)

    op.alter_column('tallySheetVersion', 'tallySheetVersionCode',
                    existing_type=mysql.ENUM('CE_201', 'CE_201_PV', 'PRE_28', 'PRE_41', 'PRE_30_PD', 'PRE_30_ED',
                                             'PRE_21', 'PRE_34_CO', 'PRE_34_I_RO', 'PRE_34_II_RO', 'PRE_34_RO',
                                             'PRE_ALL_ISLAND_RESULTS_BY_ELECTORAL_DISTRICTS', 'PRE_ALL_ISLAND_RESULTS'),
                    nullable=False)
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('submission',
                    'score',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.alter_column('submission',
                    'member',
                    existing_type=mysql.VARCHAR(length=50),
                    nullable=True)
    op.alter_column('submission',
                    'medium',
                    existing_type=mysql.ENUM('Paper', 'Phone'),
                    nullable=True)
    op.alter_column('submission',
                    'application',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.drop_column('submission', 'created')
    op.alter_column('criteria',
                    'weight',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.alter_column('criteria',
                    'name',
                    existing_type=mysql.VARCHAR(length=25),
                    nullable=True)
    op.alter_column('criteria',
                    'min_score',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.alter_column('criteria',
                    'medium',
                    existing_type=mysql.ENUM('Paper', 'Phone'),
                    nullable=True)
    op.alter_column('criteria',
                    'max_score',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.alter_column('application',
                    'team',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True)
    op.alter_column('application',
                    'gender',
                    existing_type=mysql.ENUM('Male', 'Female', 'Other'),
                    nullable=True)
    op.alter_column('application',
                    'body',
                    existing_type=mysql.VARCHAR(length=6000),
                    nullable=True)
    op.drop_column('application', 'created')
Exemple #16
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('equity_historical_data', sa.Column('barSize', mysql.ENUM('SEC_1', 'SEC_5', 'SEC_10', 'SEC_15', 'SEC_30', 'MIN_1', 'MIN_2', 'MIN_3', 'MIN_5', 'MIN_10', 'MIN_15', 'MIN_20', 'MIN_30', 'HOUR_1', 'HOUR_2', 'HOUR_3', 'HOUR_4', 'HOUR_8', 'DAY_1', 'WEEK_1', 'MONTH_1', collation='utf8mb4_unicode_ci'), nullable=False))
    op.add_column('equity_historical_data', sa.Column('barCount', mysql.FLOAT(), nullable=False))
    op.add_column('equity_historical_data', sa.Column('dataType', mysql.ENUM('TRADES', 'MIDPOINT', 'BID', 'ASK', 'BID_ASK', 'HISTORICAL_VOLATILITY', 'OPTION_IMPLIED_VOLATILITY', collation='utf8mb4_unicode_ci'), nullable=False))
    op.drop_column('equity_historical_data', 'data_type')
    op.drop_column('equity_historical_data', 'bar_size')
    op.drop_column('equity_historical_data', 'bar_count')
    op.add_column('equity', sa.Column('ib_conn_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'equity', type_='unique')
    op.drop_column('equity', 'should_update')
    op.drop_column('equity', 'name')
    op.drop_column('equity', 'ib_con_id')
Exemple #17
0
class Domain(db.Model):
    domain_name = db.Column(db.String(255), primary_key=True, nullable=False)
    prefix = db.Column(db.String(50), unique=True, nullable=False)
    maxaccounts = db.Column(mysql.INTEGER(11), nullable=False, default=20)
    quota = db.Column(mysql.INTEGER(10), nullable=False, default=20000)
    transport = db.Column(db.String(255), nullable=False, default='cyrus')
    backupmx = db.Column(mysql.TINYINT(1), nullable=False, default='0')
    freenames = db.Column(mysql.ENUM('YES', 'NO'),
                          nullable=False,
                          default='NO')
    freeaddress = db.Column(mysql.ENUM('YES', 'NO'),
                            nullable=False,
                            default='NO')
Exemple #18
0
class inbox(Base):
    __tablename__ = 'inbox'
    UpdatedInDB = Column(TIMESTAMP,
                         nullable=False,
                         default=datetime.utcnow,
                         onupdate=datetime.utcnow)
    ReceivingDateTime = Column(TIMESTAMP,
                               nullable=False,
                               server_default=func.now())
    Text = Column(TEXT, nullable=False)
    SenderNumber = Column(String(20), nullable=False, server_default='')
    Coding = Column(mysql.ENUM('Default_No_Compression',
                               'Unicode_No_Compression', '8bit',
                               'Default_Compression', 'Unicode_Compression'),
                    nullable=False,
                    server_default='Default_No_Compression')
    UDH = Column(TEXT, nullable=False)
    SMSCNumber = Column(String(20), nullable=False, server_default='')
    Class = Column(Integer, nullable=False, server_default='-1')
    TextDecoded = Column(TEXT, nullable=False)
    ID = Column(INTEGER(unsigned=True),
                nullable=False,
                primary_key=True,
                autoincrement=True)
    RecipientID = Column(TEXT, nullable=False)
    Processed = Column(mysql.ENUM('false', 'true'),
                       nullable=False,
                       server_default='false')
    Status = Column(Integer, nullable=False, server_default="-1")
    __table_args__ = {'mysql_engine': 'MyISAM', 'mysql_charset': 'utf8mb4'}

    def as_json(self):
        return {
            'ID': self.ID,
            'UpdatedInDB': datetime.isoformat(self.UpdatedInDB),
            'ReceivingDateTime': datetime.isoformat(self.ReceivingDateTime),
            'Text': self.Text,
            'SenderNumber': self.SenderNumber,
            'Coding': self.Coding,
            'UDH': self.UDH,
            'SMSCNumber': self.SMSCNumber,
            'Class': self.Class,
            'TextDecoded': self.TextDecoded,
            'RecipientID': self.RecipientID,
            'Processed': self.Processed,
            'Status': self.Status
        }

    def __repr__(self):
        return json.dumps(self.as_json())
Exemple #19
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'feature_request', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('title', sa.String(length=120), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.Column('client',
                  mysql.ENUM('Client A', 'Client B', 'Client C'),
                  nullable=False),
        sa.Column('client_priority', sa.SmallInteger(), nullable=False),
        sa.Column('target_date', sa.Date(), nullable=False),
        sa.Column('product_area',
                  mysql.ENUM('Policies', 'Billing', 'Claims', 'Reports'),
                  nullable=False), sa.PrimaryKeyConstraint('id'))
Exemple #20
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.rename_table('notice', 'notices')
    op.alter_column('attendance_post_rel',
                    'deleted',
                    existing_type=mysql.TINYINT(display_width=1),
                    type_=sa.Boolean(),
                    existing_nullable=False)
    op.add_column('comments', sa.Column('post_id',
                                        sa.Integer(),
                                        nullable=False))
    op.alter_column('comments',
                    'deleted',
                    existing_type=mysql.TINYINT(display_width=1),
                    type_=sa.Boolean(),
                    existing_nullable=False)
    op.create_foreign_key(None, 'comments', 'posts', ['post_id'], ['id'])
    op.add_column(
        'posts',
        sa.Column('contact',
                  sa.String(length=20),
                  nullable=True,
                  comment='联系人'))
    op.add_column('posts',
                  sa.Column('phone', sa.String(length=20), nullable=True))
    op.alter_column('posts',
                    'deleted',
                    existing_type=mysql.TINYINT(display_width=1),
                    type_=sa.Boolean(),
                    existing_nullable=False)
    op.alter_column('posts',
                    'type',
                    existing_type=mysql.ENUM('lost',
                                             'found',
                                             charset='utf8mb4',
                                             collation='utf8mb4_general_ci'),
                    type_=mysql.ENUM('lost', 'found', 'people'),
                    existing_comment='文章类型',
                    existing_nullable=True)
    op.alter_column('posts',
                    'user_id',
                    existing_type=mysql.INTEGER(display_width=11),
                    nullable=True,
                    comment='用户ID')
    op.alter_column('users',
                    'deleted',
                    existing_type=mysql.TINYINT(display_width=1),
                    type_=sa.Boolean(),
                    existing_nullable=False)
Exemple #21
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('ship', sa.Column('updated_at8', sa.DATE(), nullable=True))
    op.drop_column('ship', 'updated_at')
    op.add_column('samples', sa.Column('updated_at9', sa.DATE(),
                                       nullable=True))
    op.drop_column('samples', 'updated_at')
    op.add_column('pickup', sa.Column('updated_at6', sa.DATE(), nullable=True))
    op.drop_column('pickup', 'updated_at')
    op.add_column('pack', sa.Column('updated_at7', sa.DATE(), nullable=True))
    op.drop_column('pack', 'updated_at')
    op.add_column('order_item',
                  sa.Column('updated_at4', sa.DATE(), nullable=True))
    op.drop_column('order_item', 'updated_at')
    op.add_column('order', sa.Column('updated_at5', sa.DATE(), nullable=True))
    op.drop_column('order', 'updated_at')
    op.add_column('inventory',
                  sa.Column('updated_at3', sa.DATE(), nullable=True))
    op.drop_index(op.f('ix_inventory_inbound_id'), table_name='inventory')
    op.alter_column('inventory',
                    'status',
                    existing_type=mysql.ENUM('READY', 'LOCK'),
                    nullable=False)
    op.drop_column('inventory', 'updated_at')
    op.drop_column('inventory', 'inbound_id')
    op.add_column('inbound_item',
                  sa.Column('updated_at1', sa.DATE(), nullable=True))
    op.drop_column('inbound_item', 'updated_at')
    op.add_column('inbound', sa.Column('updated_at2', sa.DATE(),
                                       nullable=True))
    op.drop_column('inbound', 'updated_at')
    op.drop_column('inbound', 'status')
    op.drop_column('inbound', 'receive_by')
Exemple #22
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('meal', 'time_of_day',
               existing_type=mysql.ENUM('BREAKFAST', 'LUNCH', 'DINNER', ''),
               nullable=False,
               existing_server_default=sa.text("'DINNER'"))
    op.drop_table('user')
Exemple #23
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'user', sa.Column('role',
                          mysql.ENUM('admin', 'trader'),
                          nullable=False))
    op.drop_column('user', 'admin')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('sensor_attribute', 'measurement_pattern')
    op.drop_column('power_supply_attribute', 'measurement_pattern')
    op.drop_column('environment_sensor_attribute', 'measurement_pattern')
    op.drop_column('controller_power_supply_attribute', 'measurement_pattern')
    op.drop_column('controller_attribute', 'measurement_pattern')
    op.create_table(
        'energy_optimazation_target',
        sa.Column('type',
                  mysql.ENUM(u'binary', u'continuous', u'integer',
                             u'discrete'),
                  server_default=sa.text(u"'continuous'"),
                  nullable=True),
        sa.Column('unit', mysql.VARCHAR(length=36), nullable=True),
        sa.Column('mean', mysql.FLOAT(), nullable=True),
        sa.Column('deviation', mysql.FLOAT(), nullable=True),
        sa.Column('max', mysql.FLOAT(), nullable=True),
        sa.Column('min', mysql.FLOAT(), nullable=True),
        sa.Column('differentiation_mean', mysql.FLOAT(), nullable=True),
        sa.Column('differentiation_deviation', mysql.FLOAT(), nullable=True),
        sa.Column('differentiation_max', mysql.FLOAT(), nullable=True),
        sa.Column('differentiation_min', mysql.FLOAT(), nullable=True),
        sa.Column('possible_values', mysql.JSON(), nullable=True),
        sa.Column('datacenter_name', mysql.VARCHAR(length=36), nullable=False),
        sa.Column('name', mysql.VARCHAR(length=36), nullable=False),
        sa.Column('properties', mysql.JSON(), nullable=True),
        sa.ForeignKeyConstraint(['datacenter_name'], [u'datacenter.name'],
                                name=u'energy_optimazation_target_ibfk_1',
                                onupdate=u'CASCADE',
                                ondelete=u'CASCADE'),
        sa.PrimaryKeyConstraint('datacenter_name', 'name'),
        mysql_default_charset=u'latin1',
        mysql_engine=u'InnoDB')
Exemple #25
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'banner',
        sa.Column('is_delete',
                  mysql.ENUM('DELETE', 'NOT_DELETE'),
                  nullable=True))
Exemple #26
0
class CACert(_ExternalInterfaceMixin, Base):

    __tablename__ = 'ca_cert'
    __table_args__ = {
        'mysql_engine': MYSQL_ENGINE,
        'mysql_charset': MYSQL_CHARSET,
    }

    ca_label = Column(String(100), primary_key=True)
    certificate = Column(LargeBinary)
    profile = Column(mysql.ENUM(CLIENT_CA_PROFILE_NAME,
                                SERVICE_CA_PROFILE_NAME),
                     nullable=True)
    ssl_config = Column(LargeBinary)
    parent_ca_label = Column(String(100), ForeignKey(ca_label))

    children_ca = relationship('CACert',
                               backref=backref('parent_ca',
                                               remote_side=ca_label))
    certs = relationship('Cert', back_populates='ca_cert')

    def __repr__(self):
        return ('<CACert ca_label={!r}, profile={!r}, '
                'parent_ca_label={!r}>'.format(self.ca_label, self.profile,
                                               self.parent_ca_label))

    def __str__(self):
        return 'CACert "{} -- {}"'.format(self.ca_label, self.profile)

    _columns_to_validate = ['ca_label']
Exemple #27
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'stock_splits', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('symbol', sa.Text(), nullable=True),
        sa.Column('numerator', sa.Integer(), nullable=True),
        sa.Column('denominator', sa.Integer(), nullable=True),
        sa.Column('exec_date', sa.Float(precision=32), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.add_column(
        'game_balances',
        sa.Column('transaction_type',
                  sa.Enum('kickoff',
                          'stock_purchase',
                          'stock_sale',
                          'stock_dividend',
                          'stock_split',
                          name='gamebalancetransactiontypes'),
                  nullable=True))
    op.alter_column('game_status',
                    'status',
                    existing_type=mysql.ENUM('pending', 'active', 'finished',
                                             'expired', 'cancelled'),
                    nullable=True)
    op.alter_column('games',
                    'duration',
                    existing_type=mysql.INTEGER,
                    nullable=False,
                    type_=mysql.FLOAT(precision=32))
Exemple #28
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('people',
                    sa.Column('id',
                              mysql.INTEGER(display_width=11),
                              nullable=False),
                    sa.Column('email',
                              mysql.VARCHAR(length=120),
                              nullable=False),
                    sa.Column('password',
                              mysql.VARCHAR(length=128),
                              nullable=False),
                    sa.Column('first_name',
                              mysql.VARCHAR(length=100),
                              nullable=False),
                    sa.Column('last_name',
                              mysql.VARCHAR(length=100),
                              nullable=False),
                    sa.Column('group',
                              mysql.ENUM(u'Admin', u'Management',
                                         u'Coordinator', u'Surveyor'),
                              nullable=False),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset=u'latin1',
                    mysql_engine=u'InnoDB')
    op.drop_table('user_roles')
    op.drop_table('user_invite')
    op.drop_table('user')
    op.drop_table('role')
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tallySheetVersionRow_CE_201_ballotBox',
                    sa.Column('tallySheetVersionRowId',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=False),
                    sa.Column('ballotBoxStationaryItemId',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=False),
                    sa.Column('invoiceStage',
                              mysql.ENUM('Issued', 'Received'),
                              nullable=False),
                    sa.ForeignKeyConstraint(
                        ['ballotBoxStationaryItemId'],
                        ['ballotBox.stationaryItemId'],
                        name='tallySheetVersionRow_CE_201_ballotBox_ibfk_1'),
                    sa.ForeignKeyConstraint(
                        ['tallySheetVersionRowId'],
                        ['tallySheetVersionRow_CE_201.tallySheetVersionRowId'],
                        name='tallySheetVersionRow_CE_201_ballotBox_ibfk_2'),
                    sa.PrimaryKeyConstraint('tallySheetVersionRowId',
                                            'ballotBoxStationaryItemId',
                                            'invoiceStage'),
                    mysql_default_charset='latin1',
                    mysql_engine='InnoDB')
Exemple #30
0
def downgrade():
    op.drop_constraint(
        op.f('fk__upmc_2108ab__ti_ca8868__wtti_81a2c0'),
        'user_provisional_mfa_config', type_='foreignkey')
    op.drop_table('web_token')

    op.create_table(
        'user_token',
        sa.Column('token_id', sa.String(length=36), nullable=False),
        sa.Column(
            'token_type',
            mysql.ENUM('for_mfa_config', 'for_login', 'for_password_reset'),
            nullable=False),
        sa.Column('created_on', sa.DateTime(), nullable=False),
        sa.Column('user_login', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(
            ['user_login'], ['user.login'],
            name=op.f('fk__ut_00bc55__ul_4c395a__ul_aebb81'),
            onupdate='CASCADE',
            ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('token_id'),
        mysql_charset='utf8mb4',
        mysql_collate='utf8mb4_nopad_bin',
        mysql_engine='InnoDB')
    op.create_foreign_key(
        op.f('fk__upmc_2108ab__ti_ca8868__utti_13fa09'),
        'user_provisional_mfa_config', 'user_token', ['token_id'], ['token_id'],
        onupdate='CASCADE',
        ondelete='CASCADE')