def downgrade(): op.create_table('directive_sections', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('directive_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('section_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('program_directives', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('program_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('directive_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('section_objectives', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('section_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('objective_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('object_controls', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('start_date', sa.DATE(), nullable=True), sa.Column('end_date', sa.DATE(), nullable=True), sa.Column('role', mysql.VARCHAR(length=250), nullable=True), sa.Column('notes', mysql.TEXT(), nullable=True), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('controllable_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('controllable_type', mysql.VARCHAR(length=250), nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('object_objectives', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('start_date', sa.DATE(), nullable=True), sa.Column('end_date', sa.DATE(), nullable=True), sa.Column('role', mysql.VARCHAR(length=250), nullable=True), sa.Column('notes', mysql.TEXT(), nullable=True), sa.Column('objective_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('objectiveable_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('objectiveable_type', mysql.VARCHAR(length=250), nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('calendar_entries', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('name', mysql.VARCHAR(length=250), nullable=True), sa.Column('calendar_id', mysql.VARCHAR(length=250), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('owner_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['context_id'], [u'contexts.id'], name=u'calendar_entries_ibfk_1'), sa.ForeignKeyConstraint(['owner_id'], [u'people.id'], name=u'calendar_entries_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('control_controls', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('implemented_control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('directive_controls', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('directive_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('program_controls', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('program_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('objective_controls', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('objective_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('control_sections', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('control_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('section_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('object_sections', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('modified_by_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('updated_at', mysql.DATETIME(), nullable=True), sa.Column('start_date', sa.DATE(), nullable=True), sa.Column('end_date', sa.DATE(), nullable=True), sa.Column('role', mysql.VARCHAR(length=250), nullable=True), sa.Column('notes', mysql.TEXT(), nullable=True), sa.Column('section_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('sectionable_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('sectionable_type', mysql.VARCHAR(length=250), nullable=False), sa.Column('context_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=250), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table( 'mp_software_restrictions', sa.Column('rid', sa.BigInteger(), nullable=False, autoincrement=True), sa.Column('appID', sa.String(length=50), server_default='', nullable=False), sa.Column('bundleID', sa.String(length=50), server_default='', nullable=True), sa.Column('displayName', sa.String(length=50), server_default='', nullable=False), sa.Column('processName', sa.String(length=50), server_default='', nullable=False), sa.Column('message', mysql.TEXT(), nullable=True), sa.Column('killProc', mysql.INTEGER(display_width=1, unsigned=True), server_default='1', nullable=True), sa.Column('sendEmail', mysql.INTEGER(display_width=1, unsigned=True), server_default='0', nullable=True), sa.Column('enabled', mysql.INTEGER(display_width=1, unsigned=True), server_default='0', nullable=True), sa.Column('isglobal', mysql.INTEGER(display_width=1, unsigned=True), server_default='0', nullable=True), sa.Column('mdate', sa.DateTime(), server_default='1970-01-01 00:00:00', nullable=True), sa.PrimaryKeyConstraint('rid')) op.create_index(op.f('ix_mp_software_restrictions_appid'), 'mp_software_restrictions', ['appID'], unique=False) op.create_table( 'mp_client_group_software_restrictions', sa.Column('rid', sa.BigInteger(), nullable=False, autoincrement=True), sa.Column('group_id', sa.String(length=50), server_default='', nullable=False), sa.Column('appID', sa.String(length=50), server_default='', nullable=False), sa.Column('enabled', mysql.INTEGER(display_width=1, unsigned=True), server_default='0'), sa.PrimaryKeyConstraint('rid')) op.create_index(op.f('ix_mp_client_group_software_restrictions_appid'), 'mp_client_group_software_restrictions', ['appID'], unique=False)
class KnwKBRVAL(db.Model): """Represent a KnwKBRVAL record.""" __tablename__ = 'knwKBRVAL' m_key = db.Column(db.String(255), nullable=False, primary_key=True, index=True) m_value = db.Column(db.Text().with_variant(mysql.TEXT(30), 'mysql'), nullable=False) id_knwKB = db.Column(db.MediumInteger(8, unsigned=True), db.ForeignKey(KnwKB.id), nullable=False, server_default='0', primary_key=True) kb = db.relationship( KnwKB, backref=db.backref( 'kbrvals', cascade="all, delete-orphan", collection_class=attribute_mapped_collection("m_key"))) @staticmethod def query_kb_mappings(kbid, sortby="to", key="", value="", match_type="s"): """Return a list of all mappings from the given kb, ordered by key. If key given, give only those with left side (mapFrom) = key. If value given, give only those with right side (mapTo) = value. :param kb_name: knowledge base name. if "", return all :param sortby: the sorting criteria ('from' or 'to') :param key: return only entries where key matches this :param value: return only entries where value matches this :param match_type: s=substring, e=exact, sw=startswith """ # query query = KnwKBRVAL.query.filter(KnwKBRVAL.id_knwKB == kbid) # filter if len(key) > 0: if match_type == "s": key = "%" + key + "%" elif match_type == "sw": key = key + "%" else: key = '%' if len(value) > 0: if match_type == "s": value = "%" + value + "%" elif match_type == "sw": value = value + "%" else: value = '%' query = query.filter(KnwKBRVAL.m_key.like(key), KnwKBRVAL.m_value.like(value)) # order by if sortby == "from": query = query.order_by(KnwKBRVAL.m_key) else: query = query.order_by(KnwKBRVAL.m_value) return query def to_dict(self): """Return a dict representation of KnwKBRVAL.""" # FIXME remove 'id' dependency from invenio modules return { 'id': self.m_key + "_" + str(self.id_knwKB), 'key': self.m_key, 'value': self.m_value, 'kbid': self.kb.id if self.kb else None, 'kbname': self.kb.name if self.kb else None }
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'animals', sa.Column('best_partners', LaboratoryTypes.TextTuple(), nullable=True)) op.add_column('animals', sa.Column('summary', mysql.TEXT(), nullable=True))
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('ej', 'cnpj', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=100), type_=sa.String(length=100), existing_nullable=True) op.alter_column('ej', 'imagem', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=True) op.alter_column('ej', 'nome', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=False) op.add_column('tarefa', sa.Column('semana', sa.Integer(), nullable=False)) op.alter_column('tarefa', 'descricao', existing_type=mysql.TEXT(collation='latin1_general_ci'), type_=sa.Text(), existing_nullable=False) op.alter_column('tarefa', 'icone', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=True) op.alter_column('tarefa', 'prazo', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=100), type_=sa.String(length=100), existing_nullable=True) op.alter_column('tarefa', 'titulo', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=False) op.alter_column('usuario', 'email', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=80), type_=sa.String(length=80), existing_nullable=False) op.alter_column('usuario', 'foto_trainee', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=120), type_=sa.String(length=120), existing_nullable=True) op.alter_column('usuario', 'login', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=True) op.alter_column('usuario', 'nome', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=False) op.alter_column('usuario', 'senha', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=255), type_=sa.String(length=255), existing_nullable=False) op.alter_column('usuario', 'urole', existing_type=mysql.VARCHAR(collation='latin1_general_ci', length=50), type_=sa.String(length=50), existing_nullable=False, existing_server_default=sa.text("'user'"))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('category', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('name', mysql.VARCHAR(length=15), nullable=False), sa.Column('descripcion', mysql.VARCHAR(length=15), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_default_charset='latin1', mysql_engine='InnoDB') op.create_table('faq', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=100), nullable=False), sa.Column('content', mysql.TEXT(), nullable=True), sa.Column('orden', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('creado', mysql.DATETIME(), nullable=True), sa.Column('modificado', mysql.DATETIME(), nullable=True), sa.Column('category_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['category_id'], ['category.id'], name='faq_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset='latin1', mysql_engine='InnoDB') op.create_index('title', 'faq', ['title'], unique=True) op.create_table('trophy', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('descripcion', mysql.VARCHAR(length=60), nullable=False), sa.Column('puntos', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('creado', mysql.DATETIME(), nullable=True), sa.Column('modificado', mysql.DATETIME(), nullable=True), sa.Column('file_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['file_id'], ['file.id'], name='trophy_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset='latin1', mysql_engine='InnoDB') op.create_table('knowledge', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=100), nullable=False), sa.Column('keys', mysql.VARCHAR(length=100), nullable=True), sa.Column('content', mysql.TEXT(), nullable=True), sa.Column('creado', mysql.DATETIME(), nullable=True), sa.Column('modificado', mysql.DATETIME(), nullable=True), sa.Column('department_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('access', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('rating', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['department_id'], ['department.id'], name='knowledge_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset='latin1', mysql_engine='InnoDB') op.create_index('title', 'knowledge', ['title'], unique=True) op.create_table('festive', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('descripcion', mysql.VARCHAR(length=50), nullable=False), sa.Column('fecha', mysql.DATETIME(), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_default_charset='latin1', mysql_engine='InnoDB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('dataset', sa.Column('description', mysql.TEXT(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('articles', sa.Column('body_html', mysql.TEXT(), nullable=True))
def downgrade_account(): ### commands auto generated by Alembic - please adjust! ### op.create_table('fitter_usage_entry', sa.Column('service', mysql.VARCHAR(length=100), nullable=False), sa.Column('unit', mysql.VARCHAR(length=100), nullable=True), sa.Column('volume', mysql.DECIMAL(precision=20, scale=2), nullable=False), sa.Column('resource_id', mysql.VARCHAR(length=100), nullable=False), sa.Column('tenant_id', mysql.VARCHAR(length=100), nullable=False), sa.Column('start', mysql.DATETIME(), nullable=False), sa.Column('end', mysql.DATETIME(), nullable=False), sa.Column('created', mysql.DATETIME(), nullable=False), sa.ForeignKeyConstraint( ['resource_id', 'tenant_id'], ['fitter_resources.id', 'fitter_resources.tenant_id'], name='fk_resource_constraint'), sa.PrimaryKeyConstraint('service', 'resource_id', 'tenant_id', 'start', 'end'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('fitter_sales_orders', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('tenant_id', mysql.VARCHAR(length=100), nullable=False), sa.Column('start', mysql.DATETIME(), nullable=False), sa.Column('end', mysql.DATETIME(), nullable=False), sa.ForeignKeyConstraint(['tenant_id'], ['fitter_tenants.id'], name='fitter_sales_orders_ibfk_1'), sa.PrimaryKeyConstraint('id', 'tenant_id', 'start', 'end'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('fitter_resources', sa.Column('id', mysql.VARCHAR(length=100), nullable=False), sa.Column('tenant_id', mysql.VARCHAR(length=100), nullable=False), sa.Column('info', mysql.TEXT(), nullable=True), sa.Column('created', mysql.DATETIME(), nullable=False), sa.ForeignKeyConstraint(['tenant_id'], ['fitter_tenants.id'], name='fitter_resources_ibfk_1'), sa.PrimaryKeyConstraint('id', 'tenant_id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('fitter_tenants', sa.Column('id', mysql.VARCHAR(length=100), nullable=False), sa.Column('name', mysql.TEXT(), nullable=False), sa.Column('info', mysql.TEXT(), nullable=True), sa.Column('created', mysql.DATETIME(), nullable=False), sa.Column('last_collected', mysql.DATETIME(), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('fitter_last_run', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('last_run', mysql.DATETIME(), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.drop_index(op.f('ix_service_usage_time_label'), table_name='service_usage') op.drop_table('service_usage') op.drop_table('sales_order') op.drop_table('tenant')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('users', sa.Column('passwd', mysql.TEXT(), nullable=True)) op.drop_column('users', 'password')
def downgrade(): op.create_table('tag', sa.Column('created_at', mysql.DATETIME(), nullable=False), sa.Column('updated_at', mysql.DATETIME(), nullable=False), sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('name', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_collate=u'utf8_unicode_ci', mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('entry_tag', sa.Column('entry_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('tag_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['entry_id'], [u'entry.id'], name=u'entry_tag_ibfk_1'), sa.ForeignKeyConstraint(['tag_id'], [u'tag.id'], name=u'entry_tag_ibfk_2'), mysql_collate=u'utf8_unicode_ci', mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('entry', sa.Column('created_at', mysql.DATETIME(), nullable=False), sa.Column('updated_at', mysql.DATETIME(), nullable=False), sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('account_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('title', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=128), nullable=False), sa.Column('link', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=256), nullable=False), sa.Column('description', mysql.TEXT(collation=u'utf8_unicode_ci'), nullable=False), sa.Column('publish_time', mysql.DATETIME(), nullable=False), sa.Column('source_name', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=False), sa.Column('image_url', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=256), nullable=False), sa.Column('author', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=False), sa.Column('content', mysql.TEXT(collation=u'utf8_unicode_ci'), nullable=False), sa.ForeignKeyConstraint(['account_id'], [u'account.id'], name=u'entry_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_collate=u'utf8_unicode_ci', mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('article', sa.Column('content', mysql.TEXT(), nullable=False))
def upgrade(): op.create_table('logs_idpe_connect', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('idutilisateur_peconnect', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('dateheure', mysql.DATETIME()), sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine='InnoDB') op.create_table('logs_activity', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('dateheure', mysql.DATETIME()), sa.Column('nom', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('idutilisateur_peconnect', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('siret', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('utm_medium', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('utm_source', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('utm_campaign', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine='InnoDB') op.create_table('logs_activity_recherche', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('dateheure', mysql.DATETIME()), sa.Column('idutilisateur_peconnect', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('ville', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('code_postal', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('emploi', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine='InnoDB') op.create_table('logs_activity_dpae_clean', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('idutilisateur_peconnect', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('siret', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('date_activite', mysql.DATETIME()), sa.Column('date_embauche', mysql.DATETIME()), sa.Column('type_contrat', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('duree_activite_cdd_mois', mysql.INTEGER()), sa.Column('duree_activite_cdd_jours', mysql.INTEGER()), sa.Column('diff_activite_embauche_jrs', mysql.INTEGER()), sa.Column('dc_lblprioritede', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('tranche_age', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('dc_prive_public', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.Column('duree_prise_en_charge', mysql.INTEGER()), sa.Column('dn_tailleetablissement', mysql.INTEGER()), sa.Column('code_postal', mysql.TEXT(collation='utf8mb4_unicode_ci')), sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('question', sa.Column('test', mysql.TEXT(), nullable=False))
def upgrade(): op.add_column( 'etablissements_admin_update', sa.Column('romes_to_remove', mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('bbs', sa.Column('tree_path', mysql.TEXT(), nullable=True)) op.drop_column('bbs', 'root_id')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('staff', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=64), nullable=True), sa.Column('info', mysql.VARCHAR(length=256), nullable=True), sa.Column('release_time', mysql.VARCHAR(length=128), nullable=True), sa.Column('click_count', mysql.VARCHAR(length=64), nullable=True), sa.Column('article_content', mysql.TEXT(), nullable=True), sa.Column('cover_img', mysql.VARCHAR(length=64), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_index('ix_staff_title', 'staff', ['title'], unique=True) op.create_index('ix_staff_release_time', 'staff', ['release_time'], unique=False) op.create_index('ix_staff_cover_img', 'staff', ['cover_img'], unique=False) op.create_index('ix_staff_click_count', 'staff', ['click_count'], unique=False) op.create_table('dynamic', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=64), nullable=True), sa.Column('info', mysql.VARCHAR(length=256), nullable=True), sa.Column('release_time', mysql.VARCHAR(length=128), nullable=True), sa.Column('click_count', mysql.VARCHAR(length=64), nullable=True), sa.Column('cover_img', mysql.VARCHAR(length=64), nullable=True), sa.Column('dynamic_content', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_index('ix_dynamic_title', 'dynamic', ['title'], unique=True) op.create_index('ix_dynamic_release_time', 'dynamic', ['release_time'], unique=False) op.create_index('ix_dynamic_cover_img', 'dynamic', ['cover_img'], unique=False) op.create_index('ix_dynamic_click_count', 'dynamic', ['click_count'], unique=False) op.create_table('faq', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=64), nullable=True), sa.Column('info', mysql.VARCHAR(length=256), nullable=True), sa.Column('release_time', mysql.VARCHAR(length=128), nullable=True), sa.Column('click_count', mysql.VARCHAR(length=64), nullable=True), sa.Column('cover_img', mysql.VARCHAR(length=64), nullable=True), sa.Column('faq_content', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_index('ix_faq_title', 'faq', ['title'], unique=True) op.create_index('ix_faq_release_time', 'faq', ['release_time'], unique=False) op.create_index('ix_faq_cover_img', 'faq', ['cover_img'], unique=False) op.create_index('ix_faq_click_count', 'faq', ['click_count'], unique=False) op.create_table('notice', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=64), nullable=True), sa.Column('info', mysql.VARCHAR(length=256), nullable=True), sa.Column('release_time', mysql.VARCHAR(length=128), nullable=True), sa.Column('click_count', mysql.VARCHAR(length=64), nullable=True), sa.Column('cover_img', mysql.VARCHAR(length=64), nullable=True), sa.Column('notice_content', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_index('ix_notice_title', 'notice', ['title'], unique=True) op.create_index('ix_notice_release_time', 'notice', ['release_time'], unique=False) op.create_index('ix_notice_cover_img', 'notice', ['cover_img'], unique=False) op.create_index('ix_notice_click_count', 'notice', ['click_count'], unique=False) op.create_table('news', sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False), sa.Column('title', mysql.VARCHAR(length=64), nullable=True), sa.Column('info', mysql.VARCHAR(length=256), nullable=True), sa.Column('release_time', mysql.VARCHAR(length=128), nullable=True), sa.Column('click_count', mysql.VARCHAR(length=64), nullable=True), sa.Column('cover_img', mysql.VARCHAR(length=64), nullable=True), sa.Column('new_content', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_index('ix_news_title', 'news', ['title'], unique=True) op.create_index('ix_news_release_time', 'news', ['release_time'], unique=False) op.create_index('ix_news_cover_img', 'news', ['cover_img'], unique=False) op.create_index('ix_news_click_count', 'news', ['click_count'], unique=False) op.drop_index(op.f('ix_article_title'), table_name='article') op.drop_index(op.f('ix_article_release_time'), table_name='article') op.drop_index(op.f('ix_article_cover_img'), table_name='article') op.drop_index(op.f('ix_article_click_count'), table_name='article') op.drop_index(op.f('ix_article_article_type'), table_name='article') op.drop_table('article')
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'rss_last_time', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('last_time', sa.DECIMAL(), nullable=True), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.PrimaryKeyConstraint('id')) op.create_table( 'scrapper_config', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('scrapper_name', mysql.TEXT(), nullable=False), sa.Column('headline', mysql.MEDIUMTEXT(), nullable=True), sa.Column('date_time', mysql.TEXT(), nullable=True), sa.Column('article', mysql.LONGTEXT(), nullable=True), sa.Column('story_kicker', mysql.MEDIUMTEXT(), nullable=True), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.PrimaryKeyConstraint('id')) op.create_table( 'rss_source', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('scrapper_config_id', sa.BigInteger(), nullable=True), sa.Column('url', sa.VARCHAR(length=3000), nullable=True), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.ForeignKeyConstraint(['scrapper_config_id'], ['scrapper_config.id'], onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('url')) op.create_table( 'rss_feed', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('source_url', sa.VARCHAR(length=3000), nullable=True), sa.Column('link', mysql.MEDIUMTEXT(), nullable=True), sa.Column('title', mysql.MEDIUMTEXT(), nullable=True), sa.Column('summary', mysql.LONGTEXT(), nullable=True), sa.Column('published_string', mysql.MEDIUMTEXT(), nullable=True), sa.Column('published_at', sa.DateTime(), nullable=True), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.ForeignKeyConstraint(['source_url'], ['rss_source.url'], onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id')) op.create_table( 'rss_feed_scrapped', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('rss_feed_id', sa.BigInteger(), nullable=True), sa.Column('uri', mysql.MEDIUMTEXT(), nullable=False), sa.Column('headline', mysql.MEDIUMTEXT(), nullable=False), sa.Column('story_kicker', mysql.MEDIUMTEXT(), nullable=True), sa.Column('article', mysql.LONGTEXT(), nullable=True), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.ForeignKeyConstraint(['rss_feed_id'], ['rss_feed.id'], onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id')) op.create_table( 'rss_feeds_link', sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('rss_feed_id', sa.BigInteger(), nullable=True), sa.Column('rss_feed_link', mysql.MEDIUMTEXT(), nullable=False), sa.Column('created_at', mysql.TIMESTAMP(fsp=6), server_default=sa.text('CURRENT_TIMESTAMP(6)'), nullable=False), sa.ForeignKeyConstraint(['rss_feed_id'], ['rss_feed.id'], onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id'))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('dataset', sa.Column('extra', mysql.TEXT(), nullable=True)) op.drop_column('dataset', 'header')
def downgrade(): ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('worker', schema=None) as batch_op: batch_op.drop_column('log') op.create_table('task', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('server_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('worker_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('priority', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('frame_start', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('frame_end', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('frame_current', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('status', mysql.VARCHAR(length=10), nullable=True), sa.Column('format', mysql.VARCHAR(length=10), nullable=True), sa.Column('file_path_linux', mysql.VARCHAR(length=256), nullable=True), sa.Column('file_path_win', mysql.VARCHAR(length=256), nullable=True), sa.Column('file_path_osx', mysql.VARCHAR(length=256), nullable=True), sa.Column('settings', mysql.VARCHAR(length=50), nullable=True), sa.Column('pid', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('output_path_linux', mysql.TEXT(), nullable=True), sa.Column('output_path_osx', mysql.TEXT(), nullable=True), sa.Column('output_path_win', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'latin1', mysql_engine=u'InnoDB') op.create_table('task_type', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('name', mysql.VARCHAR(length=40), nullable=False), sa.Column('url', mysql.VARCHAR(length=128), nullable=False), sa.Column('pre_command', mysql.VARCHAR(length=256), nullable=True), sa.Column('post_command', mysql.VARCHAR(length=256), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'latin1', mysql_engine=u'InnoDB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('article_img_containers', sa.Column('alt', mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=True))
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table( 'collection_edit_log', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('kind', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('before', mysql.VARCHAR(length=200), nullable=True), sa.Column('before_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('after', mysql.VARCHAR(length=200), nullable=True), sa.Column('after_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('compare', mysql.VARCHAR(length=500), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('collection_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['collection_id'], [u'collection.id'], name=u'collection_edit_log_ibfk_1'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'collection_edit_log_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('collection_kind', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('name', mysql.VARCHAR(length=100), nullable=True), sa.Column('show_order', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('invitation_code', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('code', mysql.VARCHAR(length=200), nullable=True), sa.Column('email', mysql.VARCHAR(length=100), nullable=True), sa.Column('used', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True), sa.Column('sended_at', mysql.DATETIME(), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('sender_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['sender_id'], [u'user.id'], name=u'invitation_code_ibfk_2'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'invitation_code_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('collection_like', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('collection_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['collection_id'], [u'collection.id'], name=u'collection_like_ibfk_1'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'collection_like_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('piece_edit_log', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('piece_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('kind', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('after', mysql.VARCHAR(length=200), nullable=True), sa.Column('after_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('before', mysql.VARCHAR(length=200), nullable=True), sa.Column('before_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('compare', mysql.VARCHAR(length=500), nullable=True), sa.ForeignKeyConstraint(['piece_id'], [u'piece.id'], name=u'piece_edit_log_ibfk_2'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'piece_edit_log_ibfk_3'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('piece_source', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('name', mysql.VARCHAR(length=100), nullable=True), sa.Column('count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('mail_log', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('email', mysql.VARCHAR(length=200), nullable=True), sa.Column('message', mysql.TEXT(), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('search_log', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('keyword', mysql.VARCHAR(length=200), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'search_log_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table( 'collection_edit_log_report', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('log_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('processed', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['log_id'], [u'collection_edit_log.id'], name=u'collection_edit_log_report_ibfk_3'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'collection_edit_log_report_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table( 'piece_edit_log_report', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('processed', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True), sa.Column('log_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['log_id'], [u'piece_edit_log.id'], name=u'piece_edit_log_report_ibfk_3'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'piece_edit_log_report_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('sentence', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('content', mysql.TEXT(), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('piece_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['piece_id'], [u'piece.id'], name=u'sentence_ibfk_1'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'sentence_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('piece_author', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('name', mysql.VARCHAR(length=100), nullable=True), sa.Column('count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('collection', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('title', mysql.VARCHAR(length=200), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('cover', mysql.VARCHAR(length=200), nullable=True), sa.Column('desc', mysql.TEXT(), nullable=True), sa.Column('kind_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('locked', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['kind_id'], [u'collection_kind.id'], name=u'collection_ibfk_1'), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'collection_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('click_log', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('url', mysql.VARCHAR(length=100), nullable=True), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['user_id'], [u'user.id'], name=u'click_log_ibfk_1'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB') op.create_table('collection_piece', sa.Column('id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('created_at', mysql.DATETIME(), nullable=True), sa.Column('collection_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.Column('piece_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['collection_id'], [u'collection.id'], name=u'collection_piece_ibfk_1'), sa.ForeignKeyConstraint(['piece_id'], [u'piece.id'], name=u'collection_piece_ibfk_2'), sa.PrimaryKeyConstraint('id'), mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('groups', sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), sa.Column('name', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=30), server_default=sa.text("'Users'"), nullable=False), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_index('name', 'groups', ['name'], unique=True) op.create_table('group_membership', sa.Column('user_id', mysql.INTEGER(), autoincrement=False, nullable=False), sa.Column('group_id', mysql.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['group_id'], ['groups.id'], name='group_membership_ibfk_2'), sa.ForeignKeyConstraint(['user_id'], ['employee.id'], name='group_membership_ibfk_1'), sa.PrimaryKeyConstraint('user_id', 'group_id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('changelog', sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), sa.Column('datecreated', mysql.DATETIME(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=True), sa.Column('createuserid', mysql.INTEGER(), autoincrement=False, nullable=True), sa.Column('subject', mysql.VARCHAR(length=120), nullable=True), sa.Column('post', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_table('employee', sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), sa.Column('lastname', mysql.VARCHAR(length=50), nullable=True), sa.Column('name', mysql.VARCHAR(length=255), nullable=True), sa.Column('createdate', mysql.DATETIME(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=True), sa.Column('login', mysql.VARCHAR(length=20), nullable=False), sa.Column('password', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=255), nullable=False), sa.Column('status', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=10), nullable=False), sa.Column('email', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=30), nullable=True), sa.Column('lastlogon', mysql.DATETIME(), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_index('login', 'employee', ['login'], unique=True) op.create_table('customers', sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), sa.Column('lastname', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=100), nullable=True), sa.Column('name', mysql.VARCHAR(length=100), nullable=False), sa.Column('issuenum', mysql.INTEGER(), autoincrement=False, nullable=True), sa.Column('phone', mysql.VARCHAR(length=100), nullable=False), sa.Column('email', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=100), nullable=True), sa.Column('deliverydate', mysql.DATETIME(fsp=6), nullable=True), sa.Column('message', mysql.TEXT(), nullable=True), sa.Column('isEnabled', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=4), server_default=sa.text("'No'"), nullable=False), sa.Column('status', mysql.VARCHAR(charset='utf8', collation='utf8_general_ci', length=100), nullable=True), sa.Column('lastMessageId', mysql.INTEGER(), autoincrement=False, nullable=True), sa.Column('lastsenddate', mysql.DATETIME(fsp=6), nullable=True), sa.PrimaryKeyConstraint('id'), mysql_default_charset='utf8', mysql_engine='InnoDB') op.create_index('issuenum', 'customers', ['issuenum'], unique=True) op.drop_table('tag') op.drop_table('customer')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_foreign_key('userfk', 'user', 'company', ['company_user'], ['name_company'], onupdate='CASCADE') op.create_table('demand', sa.Column('id_demand', mysql.INTEGER(display_width=255), autoincrement=True, nullable=False), sa.Column('company_demand', mysql.VARCHAR(length=255), nullable=False), sa.Column('filler_demand', mysql.VARCHAR(length=255), nullable=False), sa.Column('content_demand', mysql.TEXT(), nullable=False), sa.Column('detail_demand', mysql.TEXT(), nullable=True), sa.Column('domain_demand', mysql.TEXT(), nullable=True), sa.Column('type_demand', mysql.INTEGER(display_width=255), autoincrement=False, nullable=False), sa.Column('delete_demand', mysql.INTEGER(display_width=255), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['filler_demand'], ['user.phone_user'], name='demandfk'), sa.PrimaryKeyConstraint('id_demand'), mysql_default_charset='utf8', mysql_engine='InnoDB', mysql_row_format='COMPACT') op.create_table('policy', sa.Column('id_policy', mysql.INTEGER(display_width=255), autoincrement=True, nullable=False), sa.Column('title_policy', mysql.VARCHAR(length=255), nullable=False), sa.Column('content_policy', mysql.TEXT(), nullable=False), sa.Column('time_policy', sa.DATE(), nullable=False), sa.PrimaryKeyConstraint('id_policy'), mysql_default_charset='utf8', mysql_engine='InnoDB', mysql_row_format='COMPACT') op.create_table('company', sa.Column('code_company', mysql.VARCHAR(length=255), nullable=False), sa.Column('name_company', mysql.VARCHAR(length=255), nullable=False), sa.Column('scope_company', mysql.TEXT(), nullable=True), sa.Column('industry_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('stuffnum_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('registeredcaptial_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('createdtime_company', sa.DATE(), nullable=True), sa.Column('contactname_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('contactphone_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('address_company', mysql.VARCHAR(length=255), nullable=True), sa.Column('partner_company', mysql.TEXT(), nullable=True), sa.PrimaryKeyConstraint('code_company'), mysql_default_charset='utf8', mysql_engine='InnoDB', mysql_row_format='COMPACT')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('dk_goods', sa.Column('detail', mysql.TEXT(), nullable=False))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('outside_order', sa.Column('title', mysql.TEXT(), nullable=True)) op.add_column('outside_order', sa.Column('price', mysql.DECIMAL(precision=10, scale=0), nullable=True)) op.add_column('outside_order', sa.Column('pay_date', sa.DATE(), nullable=True)) op.drop_table('expenditure')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_column('bao_cate', 'cate_update_time') op.drop_column('bao_cate', 'cate_create_time') op.create_table('bao_common_attribute_value', sa.Column('value_id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('attr_key_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('value', mysql.VARCHAR(length=255), nullable=False), sa.Column('value_create_time', sa.DATE(), nullable=False), sa.Column('value_update_time', sa.DATE(), nullable=True), sa.Column('value_is_delete', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('value_id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_table('Bao_user_login_record', sa.Column('v_id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('v_host', mysql.TEXT(), nullable=True), sa.Column('v_time', mysql.TEXT(), nullable=True), sa.Column('v_agent', mysql.TEXT(), nullable=True), sa.Column('v_referer', mysql.TEXT(), nullable=True), sa.Column('v_encoding', mysql.TEXT(), nullable=True), sa.Column('v_language', mysql.TEXT(), nullable=True), sa.Column('v_ip', mysql.TEXT(), nullable=True), sa.Column('v_user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('v_id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_table('bao_common_attribute_key', sa.Column('attr_id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('cate_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.Column('attr_name', mysql.VARCHAR(length=64), nullable=False), sa.Column('attr_index', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('attr_order', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('is_linked', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('attr_input_type', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('attr_values', mysql.TEXT(), nullable=False), sa.Column('attr_group', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('attr_can_muti', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.Column('attr_create_time', sa.DATE(), nullable=False), sa.Column('attr_update_time', sa.DATE(), nullable=True), sa.Column('attr_is_delete', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('attr_id'), mysql_default_charset='utf8', mysql_engine='InnoDB' ) op.create_table('bao_blog_detail', sa.Column('blog_id', mysql.INTEGER(display_width=11), nullable=False), sa.Column('blog_title', mysql.TEXT(), nullable=False), sa.Column('blog_subheading', mysql.TEXT(), nullable=True), sa.Column('blog_create_time_tuple', mysql.VARCHAR(length=32), nullable=False), sa.Column('blog_current_edit_tuple', mysql.VARCHAR(length=32), nullable=False), sa.Column('blog_content', mysql.TEXT(), nullable=True), sa.Column('blog_creater_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('blog_id'), mysql_default_charset='utf8', mysql_engine='InnoDB' )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('musers', sa.Column('about_me', mysql.TEXT(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('gcp_tasks', 'result', existing_type=mysql.MEDIUMTEXT(), type_=mysql.TEXT())
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'tx_list_eos', sa.Column('_id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('update_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('deleted_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False), sa.Column('tx_id', sa.String(length=32), server_default='', nullable=False), sa.Column('tx_no', sa.String(length=128), server_default='', nullable=False), sa.Column('vout', sa.INTEGER(), server_default='0', nullable=False), sa.Column('block_no', sa.INTEGER(), nullable=False), sa.Column('value', sa.Numeric(precision=21, scale=18), nullable=False), sa.Column('address', sa.String(length=255), server_default='', nullable=False), sa.Column('cost_flag', mysql.TINYINT(display_width=4), nullable=False), sa.Column('source_status', sa.String(length=8), server_default='0', nullable=False), sa.Column('do_recharge_result', sa.String(length=255), server_default='', nullable=False), sa.PrimaryKeyConstraint('_id'), sa.UniqueConstraint('tx_no')) op.create_table( 'tx_listening_eos', sa.Column('_id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('update_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('deleted_at', sa.DateTime(), server_default='0000-00-00 00:00:00', nullable=False), sa.Column('deleted', sa.Boolean(), server_default='0', nullable=False), sa.Column('order_no', sa.String(length=32), server_default='', nullable=False), sa.Column('record_no', sa.String(length=32), server_default='', nullable=False), sa.Column('block_no', sa.INTEGER(), nullable=False), sa.Column('tx_no', sa.String(length=128), server_default='', nullable=False), sa.Column('tx_nos', mysql.TEXT(), nullable=True), sa.Column('withdraw_type', sa.String(length=8), server_default='', nullable=False), sa.Column('listen_flag', mysql.TINYINT(display_width=4), nullable=False), sa.Column('source_status', sa.String(length=8), server_default='0', nullable=False), sa.Column('multi_flag', mysql.TINYINT(display_width=4), nullable=False), sa.PrimaryKeyConstraint('_id'), sa.UniqueConstraint('order_no'), sa.UniqueConstraint('tx_no')) op.add_column( 'tx_list_eth', sa.Column('symbol', sa.String(length=32), server_default='EOS', nullable=False))