!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/alt/python37/lib/python3.7/site-packages/lvestats/utils/dbmigrator/versions/   drwxr-xr-x
Free 223.9 GB of 981.82 GB (22.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     54d3ae3043dd_snapshot_changes.py (2.9 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

from __future__ import absolute_import
import os
import logging
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError
from alembic import op

from lvestats.orm.const import LVE_STATS_2_TABLENAME_PREFIX, SERVER_ID_LENGTH

"""snapshot changes

Revision ID: 54d3ae3043dd
Revises: 15fed017ca0b
Create Date: 2016-08-17 06:13:24.019719

"""

# revision identifiers, used by Alembic.
revision = '54d3ae3043dd'
down_revision = '15fed017ca0b'
branch_labels = None
depends_on = None

INCIDENT_TABLE = LVE_STATS_2_TABLENAME_PREFIX + 'incident'
SNAPSHOT_TABLE = LVE_STATS_2_TABLENAME_PREFIX + 'snapshot'

logger = logging.getLogger('alembic.script.%s' % os.path.basename(__name__))


def upgrade():
    # Lets clean up old data, we will not migrate it on upgrade or downgrade
    op.execute("delete from " + INCIDENT_TABLE)

    op.add_column(INCIDENT_TABLE, sa.Column('dump_time', sa.Integer(), nullable=True))
    op.add_column(INCIDENT_TABLE, sa.Column('snapshot_count', sa.Integer(), nullable=True))
    op.drop_table(SNAPSHOT_TABLE)


def downgrade():
    # due to sqlite not supporting drop column... lets re-create it
    # we wanted to remove data anyway

    op.drop_table(INCIDENT_TABLE)
    op.create_table(INCIDENT_TABLE,
                    sa.Column('uid', sa.INTEGER(), index=True, primary_key=True, autoincrement=False),
                    sa.Column('server_id', sa.VARCHAR(length=SERVER_ID_LENGTH), index=True, primary_key=True),
                    sa.Column('incident_start_time', sa.INTEGER(), index=True, primary_key=True, autoincrement=False),
                    sa.Column('incident_end_time', sa.INTEGER(), index=True)
                    )
    try:
        op.create_table(SNAPSHOT_TABLE,
                        sa.Column('uid', sa.INTEGER(), nullable=False),
                        sa.Column('server_id', sa.VARCHAR(length=255), nullable=False),
                        sa.Column('incident_start_time', sa.INTEGER(), nullable=False),
                        sa.Column('dump_time', sa.INTEGER(), nullable=False),
                        sa.Column('snap_proc', sa.TEXT(), nullable=True),
                        sa.Column('snap_sql', sa.TEXT(), nullable=True),
                        sa.Column('snap_http', sa.TEXT(), nullable=True),
                        sa.Column('snap_faults', sa.TEXT(), nullable=True),
                        sa.PrimaryKeyConstraint('uid', 'server_id', 'incident_start_time', 'dump_time')
                        )
    except OperationalError as ex:
        # for backward compatibility with old lve-create-db (lve-stats <= 2.3-x)
        if 'table {} already exists'.format(SNAPSHOT_TABLE) in ex.message:  # pylint: disable=exception-message-attribute
            logger.warning(str(ex))
        else:
            raise

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0125 ]--