# -*- coding: utf-8 -*-
"""
Created on 2017-6-29

@author: cheng.li
"""

from sqlalchemy import BigInteger, Column, DateTime, Float, Index, Integer, String
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()
metadata = Base.metadata


class DailyReturn(Base):
    __tablename__ = 'daily_return'
    __table_args__ = (
        Index('daily_return_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    d1 = Column(Float)


class Uqer(Base):
    __tablename__ = 'uqer'
    __table_args__ = (
        Index('uqer_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    AccountsPayablesTDays = Column(Float(asdecimal=True))
    AccountsPayablesTRate = Column(Float(asdecimal=True))
    AdminiExpenseRate = Column(Float(asdecimal=True))
    ARTDays = Column(Float(asdecimal=True))
    ARTRate = Column(Float(asdecimal=True))
    ASSI = Column(Float(asdecimal=True))
    BLEV = Column(Float(asdecimal=True))
    BondsPayableToAsset = Column(Float(asdecimal=True))
    CashRateOfSales = Column(Float(asdecimal=True))
    CashToCurrentLiability = Column(Float(asdecimal=True))
    CMRA = Column(Float(asdecimal=True))
    CTOP = Column(Float(asdecimal=True))
    CTP5 = Column(Float(asdecimal=True))
    CurrentAssetsRatio = Column(Float(asdecimal=True))
    CurrentAssetsTRate = Column(Float(asdecimal=True))
    CurrentRatio = Column(Float(asdecimal=True))
    DAVOL10 = Column(Float(asdecimal=True))
    DAVOL20 = Column(Float(asdecimal=True))
    DAVOL5 = Column(Float(asdecimal=True))
    DDNBT = Column(Float(asdecimal=True))
    DDNCR = Column(Float(asdecimal=True))
    DDNSR = Column(Float(asdecimal=True))
    DebtEquityRatio = Column(Float(asdecimal=True))
    DebtsAssetRatio = Column(Float(asdecimal=True))
    DHILO = Column(Float(asdecimal=True))
    DilutedEPS = Column(Float(asdecimal=True))
    DVRAT = Column(Float(asdecimal=True))
    EBITToTOR = Column(Float(asdecimal=True))
    EGRO = Column(Float(asdecimal=True))
    EMA10 = Column(Float(asdecimal=True))
    EMA120 = Column(Float(asdecimal=True))
    EMA20 = Column(Float(asdecimal=True))
    EMA5 = Column(Float(asdecimal=True))
    EMA60 = Column(Float(asdecimal=True))
    EPS = Column(Float(asdecimal=True))
    EquityFixedAssetRatio = Column(Float(asdecimal=True))
    EquityToAsset = Column(Float(asdecimal=True))
    EquityTRate = Column(Float(asdecimal=True))
    ETOP = Column(Float(asdecimal=True))
    ETP5 = Column(Float(asdecimal=True))
    FinancialExpenseRate = Column(Float(asdecimal=True))
    FinancingCashGrowRate = Column(Float(asdecimal=True))
    FixAssetRatio = Column(Float(asdecimal=True))
    FixedAssetsTRate = Column(Float(asdecimal=True))
    GrossIncomeRatio = Column(Float(asdecimal=True))
    HBETA = Column(Float(asdecimal=True))
    HSIGMA = Column(Float(asdecimal=True))
    IntangibleAssetRatio = Column(Float(asdecimal=True))
    InventoryTDays = Column(Float(asdecimal=True))
    InventoryTRate = Column(Float(asdecimal=True))
    InvestCashGrowRate = Column(Float(asdecimal=True))
    LCAP = Column(Float(asdecimal=True))
    LFLO = Column(Float(asdecimal=True))
    LongDebtToAsset = Column(Float(asdecimal=True))
    LongDebtToWorkingCapital = Column(Float(asdecimal=True))
    LongTermDebtToAsset = Column(Float(asdecimal=True))
    MA10 = Column(Float(asdecimal=True))
    MA120 = Column(Float(asdecimal=True))
    MA20 = Column(Float(asdecimal=True))
    MA5 = Column(Float(asdecimal=True))
    MA60 = Column(Float(asdecimal=True))
    MAWVAD = Column(Float(asdecimal=True))
    MFI = Column(Float(asdecimal=True))
    MLEV = Column(Float(asdecimal=True))
    NetAssetGrowRate = Column(Float(asdecimal=True))
    NetProfitGrowRate = Column(Float(asdecimal=True))
    NetProfitRatio = Column(Float(asdecimal=True))
    NOCFToOperatingNI = Column(Float(asdecimal=True))
    NonCurrentAssetsRatio = Column(Float(asdecimal=True))
    NPParentCompanyGrowRate = Column(Float(asdecimal=True))
    NPToTOR = Column(Float(asdecimal=True))
    OperatingExpenseRate = Column(Float(asdecimal=True))
    OperatingProfitGrowRate = Column(Float(asdecimal=True))
    OperatingProfitRatio = Column(Float(asdecimal=True))
    OperatingProfitToTOR = Column(Float(asdecimal=True))
    OperatingRevenueGrowRate = Column(Float(asdecimal=True))
    OperCashGrowRate = Column(Float(asdecimal=True))
    OperCashInToCurrentLiability = Column(Float(asdecimal=True))
    PB = Column(Float(asdecimal=True))
    PCF = Column(Float(asdecimal=True))
    PE = Column(Float(asdecimal=True))
    PS = Column(Float(asdecimal=True))
    PSY = Column(Float(asdecimal=True))
    QuickRatio = Column(Float(asdecimal=True))
    REVS10 = Column(Float(asdecimal=True))
    REVS20 = Column(Float(asdecimal=True))
    REVS5 = Column(Float(asdecimal=True))
    ROA = Column(Float(asdecimal=True))
    ROA5 = Column(Float(asdecimal=True))
    ROE = Column(Float(asdecimal=True))
    ROE5 = Column(Float(asdecimal=True))
    RSI = Column(Float(asdecimal=True))
    RSTR12 = Column(Float(asdecimal=True))
    RSTR24 = Column(Float(asdecimal=True))
    SalesCostRatio = Column(Float(asdecimal=True))
    SaleServiceCashToOR = Column(Float(asdecimal=True))
    SUE = Column(Float(asdecimal=True))
    TaxRatio = Column(Float(asdecimal=True))
    TOBT = Column(Float(asdecimal=True))
    TotalAssetGrowRate = Column(Float(asdecimal=True))
    TotalAssetsTRate = Column(Float(asdecimal=True))
    TotalProfitCostRatio = Column(Float(asdecimal=True))
    TotalProfitGrowRate = Column(Float(asdecimal=True))
    VOL10 = Column(Float(asdecimal=True))
    VOL120 = Column(Float(asdecimal=True))
    VOL20 = Column(Float(asdecimal=True))
    VOL240 = Column(Float(asdecimal=True))
    VOL5 = Column(Float(asdecimal=True))
    VOL60 = Column(Float(asdecimal=True))
    WVAD = Column(Float(asdecimal=True))
    REC = Column(Float(asdecimal=True))
    DAREC = Column(Float(asdecimal=True))
    GREC = Column(Float(asdecimal=True))
    FY12P = Column(Float(asdecimal=True))
    DAREV = Column(Float(asdecimal=True))
    GREV = Column(Float(asdecimal=True))
    SFY12P = Column(Float(asdecimal=True))
    DASREV = Column(Float(asdecimal=True))
    GSREV = Column(Float(asdecimal=True))
    FEARNG = Column(Float(asdecimal=True))
    FSALESG = Column(Float(asdecimal=True))
    TA2EV = Column(Float(asdecimal=True))
    CFO2EV = Column(Float(asdecimal=True))
    ACCA = Column(Float(asdecimal=True))
    DEGM = Column(Float(asdecimal=True))
    SUOI = Column(Float(asdecimal=True))
    EARNMOM = Column(Float(asdecimal=True))
    FiftyTwoWeekHigh = Column(Float(asdecimal=True))
    Volatility = Column(Float(asdecimal=True))
    Skewness = Column(Float(asdecimal=True))
    ILLIQUIDITY = Column(Float(asdecimal=True))
    BackwardADJ = Column(Float(asdecimal=True))
    MACD = Column(Float(asdecimal=True))
    ADTM = Column(Float(asdecimal=True))
    ATR14 = Column(Float(asdecimal=True))
    ATR6 = Column(Float(asdecimal=True))
    BIAS10 = Column(Float(asdecimal=True))
    BIAS20 = Column(Float(asdecimal=True))
    BIAS5 = Column(Float(asdecimal=True))
    BIAS60 = Column(Float(asdecimal=True))
    BollDown = Column(Float(asdecimal=True))
    BollUp = Column(Float(asdecimal=True))
    CCI10 = Column(Float(asdecimal=True))
    CCI20 = Column(Float(asdecimal=True))
    CCI5 = Column(Float(asdecimal=True))
    CCI88 = Column(Float(asdecimal=True))
    KDJ_K = Column(Float(asdecimal=True))
    KDJ_D = Column(Float(asdecimal=True))
    KDJ_J = Column(Float(asdecimal=True))
    ROC6 = Column(Float(asdecimal=True))
    ROC20 = Column(Float(asdecimal=True))
    SBM = Column(Float(asdecimal=True))
    STM = Column(Float(asdecimal=True))
    UpRVI = Column(Float(asdecimal=True))
    DownRVI = Column(Float(asdecimal=True))
    RVI = Column(Float(asdecimal=True))
    SRMI = Column(Float(asdecimal=True))
    ChandeSD = Column(Float(asdecimal=True))
    ChandeSU = Column(Float(asdecimal=True))
    CMO = Column(Float(asdecimal=True))
    DBCD = Column(Float(asdecimal=True))
    ARC = Column(Float(asdecimal=True))
    OBV = Column(Float(asdecimal=True))
    OBV6 = Column(Float(asdecimal=True))
    OBV20 = Column(Float(asdecimal=True))
    TVMA20 = Column(Float(asdecimal=True))
    TVMA6 = Column(Float(asdecimal=True))
    TVSTD20 = Column(Float(asdecimal=True))
    TVSTD6 = Column(Float(asdecimal=True))
    VDEA = Column(Float(asdecimal=True))
    VDIFF = Column(Float(asdecimal=True))
    VEMA10 = Column(Float(asdecimal=True))
    VEMA12 = Column(Float(asdecimal=True))
    VEMA26 = Column(Float(asdecimal=True))
    VEMA5 = Column(Float(asdecimal=True))
    VMACD = Column(Float(asdecimal=True))
    VOSC = Column(Float(asdecimal=True))
    VR = Column(Float(asdecimal=True))
    VROC12 = Column(Float(asdecimal=True))
    VROC6 = Column(Float(asdecimal=True))
    VSTD10 = Column(Float(asdecimal=True))
    VSTD20 = Column(Float(asdecimal=True))
    KlingerOscillator = Column(Float(asdecimal=True))
    MoneyFlow20 = Column(Float(asdecimal=True))
    AD = Column(Float(asdecimal=True))
    AD20 = Column(Float(asdecimal=True))
    AD6 = Column(Float(asdecimal=True))
    CoppockCurve = Column(Float(asdecimal=True))
    ASI = Column(Float(asdecimal=True))
    ChaikinOscillator = Column(Float(asdecimal=True))
    ChaikinVolatility = Column(Float(asdecimal=True))
    EMV14 = Column(Float(asdecimal=True))
    EMV6 = Column(Float(asdecimal=True))
    plusDI = Column(Float(asdecimal=True))
    minusDI = Column(Float(asdecimal=True))
    ADX = Column(Float(asdecimal=True))
    ADXR = Column(Float(asdecimal=True))
    Aroon = Column(Float(asdecimal=True))
    AroonDown = Column(Float(asdecimal=True))
    AroonUp = Column(Float(asdecimal=True))
    DEA = Column(Float(asdecimal=True))
    DIFF = Column(Float(asdecimal=True))
    DDI = Column(Float(asdecimal=True))
    DIZ = Column(Float(asdecimal=True))
    DIF = Column(Float(asdecimal=True))
    MTM = Column(Float(asdecimal=True))
    MTMMA = Column(Float(asdecimal=True))
    PVT = Column(Float(asdecimal=True))
    PVT6 = Column(Float(asdecimal=True))
    PVT12 = Column(Float(asdecimal=True))
    TRIX5 = Column(Float(asdecimal=True))
    TRIX10 = Column(Float(asdecimal=True))
    UOS = Column(Float(asdecimal=True))
    MA10RegressCoeff12 = Column(Float(asdecimal=True))
    MA10RegressCoeff6 = Column(Float(asdecimal=True))
    PLRC6 = Column(Float(asdecimal=True))
    PLRC12 = Column(Float(asdecimal=True))
    SwingIndex = Column(Float(asdecimal=True))
    Ulcer10 = Column(Float(asdecimal=True))
    Ulcer5 = Column(Float(asdecimal=True))
    Hurst = Column(Float(asdecimal=True))
    ACD6 = Column(Float(asdecimal=True))
    ACD20 = Column(Float(asdecimal=True))
    EMA12 = Column(Float(asdecimal=True))
    EMA26 = Column(Float(asdecimal=True))
    APBMA = Column(Float(asdecimal=True))
    BBI = Column(Float(asdecimal=True))
    BBIC = Column(Float(asdecimal=True))
    TEMA10 = Column(Float(asdecimal=True))
    TEMA5 = Column(Float(asdecimal=True))
    MA10Close = Column(Float(asdecimal=True))
    AR = Column(Float(asdecimal=True))
    BR = Column(Float(asdecimal=True))
    ARBR = Column(Float(asdecimal=True))
    CR20 = Column(Float(asdecimal=True))
    MassIndex = Column(Float(asdecimal=True))
    BearPower = Column(Float(asdecimal=True))
    BullPower = Column(Float(asdecimal=True))
    Elder = Column(Float(asdecimal=True))
    NVI = Column(Float(asdecimal=True))
    PVI = Column(Float(asdecimal=True))
    RC12 = Column(Float(asdecimal=True))
    RC24 = Column(Float(asdecimal=True))
    JDQS20 = Column(Float(asdecimal=True))
    Variance20 = Column(Float(asdecimal=True))
    Variance60 = Column(Float(asdecimal=True))
    Variance120 = Column(Float(asdecimal=True))
    Kurtosis20 = Column(Float(asdecimal=True))
    Kurtosis60 = Column(Float(asdecimal=True))
    Kurtosis120 = Column(Float(asdecimal=True))
    Alpha20 = Column(Float(asdecimal=True))
    Alpha60 = Column(Float(asdecimal=True))
    Alpha120 = Column(Float(asdecimal=True))
    Beta20 = Column(Float(asdecimal=True))
    Beta60 = Column(Float(asdecimal=True))
    Beta120 = Column(Float(asdecimal=True))
    SharpeRatio20 = Column(Float(asdecimal=True))
    SharpeRatio60 = Column(Float(asdecimal=True))
    SharpeRatio120 = Column(Float(asdecimal=True))
    TreynorRatio20 = Column(Float(asdecimal=True))
    TreynorRatio60 = Column(Float(asdecimal=True))
    TreynorRatio120 = Column(Float(asdecimal=True))
    InformationRatio20 = Column(Float(asdecimal=True))
    InformationRatio60 = Column(Float(asdecimal=True))
    InformationRatio120 = Column(Float(asdecimal=True))
    GainVariance20 = Column(Float(asdecimal=True))
    GainVariance60 = Column(Float(asdecimal=True))
    GainVariance120 = Column(Float(asdecimal=True))
    LossVariance20 = Column(Float(asdecimal=True))
    LossVariance60 = Column(Float(asdecimal=True))
    LossVariance120 = Column(Float(asdecimal=True))
    GainLossVarianceRatio20 = Column(Float(asdecimal=True))
    GainLossVarianceRatio60 = Column(Float(asdecimal=True))
    GainLossVarianceRatio120 = Column(Float(asdecimal=True))
    RealizedVolatility = Column(Float(asdecimal=True))
    REVS60 = Column(Float(asdecimal=True))
    REVS120 = Column(Float(asdecimal=True))
    REVS250 = Column(Float(asdecimal=True))
    REVS750 = Column(Float(asdecimal=True))
    REVS5m20 = Column(Float(asdecimal=True))
    REVS5m60 = Column(Float(asdecimal=True))
    REVS5Indu1 = Column(Float(asdecimal=True))
    REVS20Indu1 = Column(Float(asdecimal=True))
    Volumn1M = Column(Float(asdecimal=True))
    Volumn3M = Column(Float(asdecimal=True))
    Price1M = Column(Float(asdecimal=True))
    Price3M = Column(Float(asdecimal=True))
    Price1Y = Column(Float(asdecimal=True))
    Rank1M = Column(Float(asdecimal=True))
    CashDividendCover = Column(Float(asdecimal=True))
    DividendCover = Column(Float(asdecimal=True))
    DividendPaidRatio = Column(Float(asdecimal=True))
    RetainedEarningRatio = Column(Float(asdecimal=True))
    CashEquivalentPS = Column(Float(asdecimal=True))
    DividendPS = Column(Float(asdecimal=True))
    EPSTTM = Column(Float(asdecimal=True))
    NetAssetPS = Column(Float(asdecimal=True))
    TORPS = Column(Float(asdecimal=True))
    TORPSLatest = Column(Float(asdecimal=True))
    OperatingRevenuePS = Column(Float(asdecimal=True))
    OperatingRevenuePSLatest = Column(Float(asdecimal=True))
    OperatingProfitPS = Column(Float(asdecimal=True))
    OperatingProfitPSLatest = Column(Float(asdecimal=True))
    CapitalSurplusFundPS = Column(Float(asdecimal=True))
    SurplusReserveFundPS = Column(Float(asdecimal=True))
    UndividedProfitPS = Column(Float(asdecimal=True))
    RetainedEarningsPS = Column(Float(asdecimal=True))
    OperCashFlowPS = Column(Float(asdecimal=True))
    CashFlowPS = Column(Float(asdecimal=True))
    NetNonOIToTP = Column(Float(asdecimal=True))
    NetNonOIToTPLatest = Column(Float(asdecimal=True))
    PeriodCostsRate = Column(Float(asdecimal=True))
    InterestCover = Column(Float(asdecimal=True))
    NetProfitGrowRate3Y = Column(Float(asdecimal=True))
    NetProfitGrowRate5Y = Column(Float(asdecimal=True))
    OperatingRevenueGrowRate3Y = Column(Float(asdecimal=True))
    OperatingRevenueGrowRate5Y = Column(Float(asdecimal=True))
    NetCashFlowGrowRate = Column(Float(asdecimal=True))
    NetProfitCashCover = Column(Float(asdecimal=True))
    OperCashInToAsset = Column(Float(asdecimal=True))
    CashConversionCycle = Column(Float(asdecimal=True))
    OperatingCycle = Column(Float(asdecimal=True))
    PEG3Y = Column(Float(asdecimal=True))
    PEG5Y = Column(Float(asdecimal=True))
    PEIndu = Column(Float(asdecimal=True))
    PBIndu = Column(Float(asdecimal=True))
    PSIndu = Column(Float(asdecimal=True))
    PCFIndu = Column(Float(asdecimal=True))
    PEHist20 = Column(Float(asdecimal=True))
    PEHist60 = Column(Float(asdecimal=True))
    PEHist120 = Column(Float(asdecimal=True))
    PEHist250 = Column(Float(asdecimal=True))
    StaticPE = Column(Float(asdecimal=True))
    ForwardPE = Column(Float(asdecimal=True))
    EnterpriseFCFPS = Column(Float(asdecimal=True))
    ShareholderFCFPS = Column(Float(asdecimal=True))
    ROEDiluted = Column(Float(asdecimal=True))
    ROEAvg = Column(Float(asdecimal=True))
    ROEWeighted = Column(Float(asdecimal=True))
    ROECut = Column(Float(asdecimal=True))
    ROECutWeighted = Column(Float(asdecimal=True))
    ROIC = Column(Float(asdecimal=True))
    ROAEBIT = Column(Float(asdecimal=True))
    ROAEBITTTM = Column(Float(asdecimal=True))
    OperatingNIToTP = Column(Float(asdecimal=True))
    OperatingNIToTPLatest = Column(Float(asdecimal=True))
    InvestRAssociatesToTP = Column(Float(asdecimal=True))
    InvestRAssociatesToTPLatest = Column(Float(asdecimal=True))
    NPCutToNP = Column(Float(asdecimal=True))
    SuperQuickRatio = Column(Float(asdecimal=True))
    TSEPToInterestBearDebt = Column(Float(asdecimal=True))
    DebtTangibleEquityRatio = Column(Float(asdecimal=True))
    TangibleAToInteBearDebt = Column(Float(asdecimal=True))
    TangibleAToNetDebt = Column(Float(asdecimal=True))
    NOCFToTLiability = Column(Float(asdecimal=True))
    NOCFToInterestBearDebt = Column(Float(asdecimal=True))
    NOCFToNetDebt = Column(Float(asdecimal=True))
    TSEPToTotalCapital = Column(Float(asdecimal=True))
    InteBearDebtToTotalCapital = Column(Float(asdecimal=True))
    NPParentCompanyCutYOY = Column(Float(asdecimal=True))
    SalesServiceCashToORLatest = Column(Float(asdecimal=True))
    CashRateOfSalesLatest = Column(Float(asdecimal=True))
    NOCFToOperatingNILatest = Column(Float(asdecimal=True))
    TotalAssets = Column(Float(asdecimal=True))
    MktValue = Column(Float(asdecimal=True))
    NegMktValue = Column(Float(asdecimal=True))
    TEAP = Column(Float(asdecimal=True))
    NIAP = Column(Float(asdecimal=True))
    TotalFixedAssets = Column(Float(asdecimal=True))
    IntFreeCL = Column(Float(asdecimal=True))
    IntFreeNCL = Column(Float(asdecimal=True))
    IntCL = Column(Float(asdecimal=True))
    IntDebt = Column(Float(asdecimal=True))
    NetDebt = Column(Float(asdecimal=True))
    NetTangibleAssets = Column(Float(asdecimal=True))
    WorkingCapital = Column(Float(asdecimal=True))
    NetWorkingCapital = Column(Float(asdecimal=True))
    TotalPaidinCapital = Column(Float(asdecimal=True))
    RetainedEarnings = Column(Float(asdecimal=True))
    OperateNetIncome = Column(Float(asdecimal=True))
    ValueChgProfit = Column(Float(asdecimal=True))
    NetIntExpense = Column(Float(asdecimal=True))
    EBIT = Column(Float(asdecimal=True))
    EBITDA = Column(Float(asdecimal=True))
    EBIAT = Column(Float(asdecimal=True))
    NRProfitLoss = Column(Float(asdecimal=True))
    NIAPCut = Column(Float(asdecimal=True))
    FCFF = Column(Float(asdecimal=True))
    FCFE = Column(Float(asdecimal=True))
    DA = Column(Float(asdecimal=True))
    TRevenueTTM = Column(Float(asdecimal=True))
    TCostTTM = Column(Float(asdecimal=True))
    RevenueTTM = Column(Float(asdecimal=True))
    CostTTM = Column(Float(asdecimal=True))
    GrossProfitTTM = Column(Float(asdecimal=True))
    SalesExpenseTTM = Column(Float(asdecimal=True))
    AdminExpenseTTM = Column(Float(asdecimal=True))
    FinanExpenseTTM = Column(Float(asdecimal=True))
    AssetImpairLossTTM = Column(Float(asdecimal=True))
    NPFromOperatingTTM = Column(Float(asdecimal=True))
    NPFromValueChgTTM = Column(Float(asdecimal=True))
    OperateProfitTTM = Column(Float(asdecimal=True))
    NonOperatingNPTTM = Column(Float(asdecimal=True))
    TProfitTTM = Column(Float(asdecimal=True))
    NetProfitTTM = Column(Float(asdecimal=True))
    NetProfitAPTTM = Column(Float(asdecimal=True))
    SaleServiceRenderCashTTM = Column(Float(asdecimal=True))
    NetOperateCFTTM = Column(Float(asdecimal=True))
    NetInvestCFTTM = Column(Float(asdecimal=True))
    NetFinanceCFTTM = Column(Float(asdecimal=True))
    GrossProfit = Column(Float(asdecimal=True))
    Beta252 = Column(Float(asdecimal=True))
    RSTR504 = Column(Float(asdecimal=True))
    EPIBS = Column(Float(asdecimal=True))
    CETOP = Column(Float(asdecimal=True))
    DASTD = Column(Float(asdecimal=True))
    CmraCNE5 = Column(Float(asdecimal=True))
    HsigmaCNE5 = Column(Float(asdecimal=True))
    SGRO = Column(Float(asdecimal=True))
    EgibsLong = Column(Float(asdecimal=True))
    STOM = Column(Float(asdecimal=True))
    STOQ = Column(Float(asdecimal=True))
    STOA = Column(Float(asdecimal=True))
    NLSIZE = Column(Float(asdecimal=True))


class HaltList(Base):
    __tablename__ = 'halt_list'
    __table_args__ = (
        Index('halt_list_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    haltBeginTime = Column(DateTime)
    haltEndTime = Column(DateTime)
    secShortName = Column(String(20))
    exchangeCD = Column(String(4))
    listStatusCD = Column(String(4))
    delistDate = Column(DateTime)
    assetClass = Column(String(4))


class IndexComponent(Base):
    __tablename__ = 'index_components'
    __table_args__ = (
        Index('index_components_Date_indexCode_Code_uindex', 'Date', 'indexCode', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    effDate = Column(DateTime)
    indexShortName = Column(String(20))
    indexCode = Column(Integer, primary_key=True, nullable=False)
    secShortName = Column(String(20))
    exchangeCD = Column(String(4))
    weight = Column(Float)


class Market(Base):
    __tablename__ = 'market'
    __table_args__ = (
        Index('market_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    secShortName = Column(String(10))
    exchangeCD = Column(String(4))
    preClosePrice = Column(Float)
    actPreClosePrice = Column(Float)
    openPrice = Column(Float)
    highestPrice = Column(Float)
    lowestPrice = Column(Float)
    closePrice = Column(Float)
    turnoverVol = Column(Integer)
    turnoverValue = Column(Float)
    dealAmount = Column(Integer)
    turnoverRate = Column(Float)
    accumAdjFactor = Column(Float)
    negMarketValue = Column(Float)
    marketValue = Column(Float)
    chgPct = Column(Float)
    PE = Column(Float)
    PE1 = Column(Float)
    PB = Column(Float)
    isOpen = Column(Integer)


class RiskCovDay(Base):
    __tablename__ = 'risk_cov_day'
    __table_args__ = (
        Index('risk_cov_day_Date_Factor_uindex', 'Date', 'Factor', unique=True),
        Index('risk_cov_day_Date_FactorID_uindex', 'Date', 'FactorID', unique=True)
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    FactorID = Column(Integer)
    Factor = Column(String(50), primary_key=True, nullable=False)
    BETA = Column(Float)
    MOMENTUM = Column(Float)
    SIZE = Column(Float)
    EARNYILD = Column(Float)
    RESVOL = Column(Float)
    GROWTH = Column(Float)
    BTOP = Column(Float)
    LEVERAGE = Column(Float)
    LIQUIDTY = Column(Float)
    SIZENL = Column(Float)
    Bank = Column(Float)
    RealEstate = Column(Float)
    Health = Column(Float)
    Transportation = Column(Float)
    Mining = Column(Float)
    NonFerMetal = Column(Float)
    HouseApp = Column(Float)
    LeiService = Column(Float)
    MachiEquip = Column(Float)
    BuildDeco = Column(Float)
    CommeTrade = Column(Float)
    CONMAT = Column(Float)
    Auto = Column(Float)
    Textile = Column(Float)
    FoodBever = Column(Float)
    Electronics = Column(Float)
    Computer = Column(Float)
    LightIndus = Column(Float)
    Utilities = Column(Float)
    Telecom = Column(Float)
    AgriForest = Column(Float)
    CHEM = Column(Float)
    Media = Column(Float)
    IronSteel = Column(Float)
    NonBankFinan = Column(Float)
    ELECEQP = Column(Float)
    AERODEF = Column(Float)
    Conglomerates = Column(Float)
    COUNTRY = Column(Float)
    updateTime = Column(DateTime)


class RiskCovLong(Base):
    __tablename__ = 'risk_cov_long'
    __table_args__ = (
        Index('risk_cov_long_Date_Factor_uindex', 'Date', 'Factor', unique=True),
        Index('risk_cov_long_Date_FactorID_uindex', 'Date', 'FactorID', unique=True)
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    FactorID = Column(Integer)
    Factor = Column(String(50), primary_key=True, nullable=False)
    BETA = Column(Float)
    MOMENTUM = Column(Float)
    SIZE = Column(Float)
    EARNYILD = Column(Float)
    RESVOL = Column(Float)
    GROWTH = Column(Float)
    BTOP = Column(Float)
    LEVERAGE = Column(Float)
    LIQUIDTY = Column(Float)
    SIZENL = Column(Float)
    Bank = Column(Float)
    RealEstate = Column(Float)
    Health = Column(Float)
    Transportation = Column(Float)
    Mining = Column(Float)
    NonFerMetal = Column(Float)
    HouseApp = Column(Float)
    LeiService = Column(Float)
    MachiEquip = Column(Float)
    BuildDeco = Column(Float)
    CommeTrade = Column(Float)
    CONMAT = Column(Float)
    Auto = Column(Float)
    Textile = Column(Float)
    FoodBever = Column(Float)
    Electronics = Column(Float)
    Computer = Column(Float)
    LightIndus = Column(Float)
    Utilities = Column(Float)
    Telecom = Column(Float)
    AgriForest = Column(Float)
    CHEM = Column(Float)
    Media = Column(Float)
    IronSteel = Column(Float)
    NonBankFinan = Column(Float)
    ELECEQP = Column(Float)
    AERODEF = Column(Float)
    Conglomerates = Column(Float)
    COUNTRY = Column(Float)
    updateTime = Column(DateTime)


class RiskCovShort(Base):
    __tablename__ = 'risk_cov_short'
    __table_args__ = (
        Index('risk_cov_short_Date_Factor_uindex', 'Date', 'Factor', unique=True),
        Index('risk_cov_short_Date_FactorID_uindex', 'Date', 'FactorID', unique=True)
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    FactorID = Column(Integer)
    Factor = Column(String(50), primary_key=True, nullable=False)
    BETA = Column(Float)
    MOMENTUM = Column(Float)
    SIZE = Column(Float)
    EARNYILD = Column(Float)
    RESVOL = Column(Float)
    GROWTH = Column(Float)
    BTOP = Column(Float)
    LEVERAGE = Column(Float)
    LIQUIDTY = Column(Float)
    SIZENL = Column(Float)
    Bank = Column(Float)
    RealEstate = Column(Float)
    Health = Column(Float)
    Transportation = Column(Float)
    Mining = Column(Float)
    NonFerMetal = Column(Float)
    HouseApp = Column(Float)
    LeiService = Column(Float)
    MachiEquip = Column(Float)
    BuildDeco = Column(Float)
    CommeTrade = Column(Float)
    CONMAT = Column(Float)
    Auto = Column(Float)
    Textile = Column(Float)
    FoodBever = Column(Float)
    Electronics = Column(Float)
    Computer = Column(Float)
    LightIndus = Column(Float)
    Utilities = Column(Float)
    Telecom = Column(Float)
    AgriForest = Column(Float)
    CHEM = Column(Float)
    Media = Column(Float)
    IronSteel = Column(Float)
    NonBankFinan = Column(Float)
    ELECEQP = Column(Float)
    AERODEF = Column(Float)
    Conglomerates = Column(Float)
    COUNTRY = Column(Float)
    updateTime = Column(DateTime)


class RiskExposure(Base):
    __tablename__ = 'risk_exposure'
    __table_args__ = (
        Index('risk_exposure_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    exchangeCD = Column(String(4))
    secShortName = Column(String(20))
    BETA = Column(Float(asdecimal=True))
    MOMENTUM = Column(Float(asdecimal=True))
    SIZE = Column(Float(asdecimal=True))
    EARNYILD = Column(Float(asdecimal=True))
    RESVOL = Column(Float(asdecimal=True))
    GROWTH = Column(Float(asdecimal=True))
    BTOP = Column(Float(asdecimal=True))
    LEVERAGE = Column(Float(asdecimal=True))
    LIQUIDTY = Column(Float(asdecimal=True))
    SIZENL = Column(Float(asdecimal=True))
    Bank = Column(BigInteger)
    RealEstate = Column(BigInteger)
    Health = Column(BigInteger)
    Transportation = Column(BigInteger)
    Mining = Column(BigInteger)
    NonFerMetal = Column(BigInteger)
    HouseApp = Column(BigInteger)
    LeiService = Column(BigInteger)
    MachiEquip = Column(BigInteger)
    BuildDeco = Column(BigInteger)
    CommeTrade = Column(BigInteger)
    CONMAT = Column(BigInteger)
    Auto = Column(BigInteger)
    Textile = Column(BigInteger)
    FoodBever = Column(BigInteger)
    Electronics = Column(BigInteger)
    Computer = Column(BigInteger)
    LightIndus = Column(BigInteger)
    Utilities = Column(BigInteger)
    Telecom = Column(BigInteger)
    AgriForest = Column(BigInteger)
    CHEM = Column(BigInteger)
    Media = Column(BigInteger)
    IronSteel = Column(BigInteger)
    NonBankFinan = Column(BigInteger)
    ELECEQP = Column(BigInteger)
    AERODEF = Column(BigInteger)
    Conglomerates = Column(BigInteger)
    COUNTRY = Column(BigInteger)
    updateTime = Column(DateTime)


class RiskReturn(Base):
    __tablename__ = 'risk_return'

    Date = Column(DateTime, primary_key=True, unique=True)
    BETA = Column(Float(asdecimal=True))
    MOMENTUM = Column(Float(asdecimal=True))
    SIZE = Column(Float(asdecimal=True))
    EARNYILD = Column(Float(asdecimal=True))
    RESVOL = Column(Float(asdecimal=True))
    GROWTH = Column(Float(asdecimal=True))
    BTOP = Column(Float(asdecimal=True))
    LEVERAGE = Column(Float(asdecimal=True))
    LIQUIDTY = Column(Float(asdecimal=True))
    SIZENL = Column(Float(asdecimal=True))
    Bank = Column(Float(asdecimal=True))
    RealEstate = Column(Float(asdecimal=True))
    Health = Column(Float(asdecimal=True))
    Transportation = Column(Float(asdecimal=True))
    Mining = Column(Float(asdecimal=True))
    NonFerMetal = Column(Float(asdecimal=True))
    HouseApp = Column(Float(asdecimal=True))
    LeiService = Column(Float(asdecimal=True))
    MachiEquip = Column(Float(asdecimal=True))
    BuildDeco = Column(Float(asdecimal=True))
    CommeTrade = Column(Float(asdecimal=True))
    CONMAT = Column(Float(asdecimal=True))
    Auto = Column(Float(asdecimal=True))
    Textile = Column(Float(asdecimal=True))
    FoodBever = Column(Float(asdecimal=True))
    Electronics = Column(Float(asdecimal=True))
    Computer = Column(Float(asdecimal=True))
    LightIndus = Column(Float(asdecimal=True))
    Utilities = Column(Float(asdecimal=True))
    Telecom = Column(Float(asdecimal=True))
    AgriForest = Column(Float(asdecimal=True))
    CHEM = Column(Float(asdecimal=True))
    Media = Column(Float(asdecimal=True))
    IronSteel = Column(Float(asdecimal=True))
    NonBankFinan = Column(Float(asdecimal=True))
    ELECEQP = Column(Float(asdecimal=True))
    AERODEF = Column(Float(asdecimal=True))
    Conglomerates = Column(Float(asdecimal=True))
    COUNTRY = Column(Float(asdecimal=True))
    updateTime = Column(DateTime)


class SpecificReturn(Base):
    __tablename__ = 'specific_return'
    __table_args__ = (
        Index('specific_return_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    exchangeCD = Column(String(4))
    secShortName = Column(String(20))
    spret = Column(Float(asdecimal=True))
    updateTime = Column(DateTime)


class SpecificRiskDay(Base):
    __tablename__ = 'specific_risk_day'
    __table_args__ = (
        Index('specific_risk_day_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    exchangeCD = Column(String(4))
    secShortName = Column(String(20))
    SRISK = Column(Float(asdecimal=True))
    updateTime = Column(DateTime)


class SpecificRiskLong(Base):
    __tablename__ = 'specific_risk_long'
    __table_args__ = (
        Index('specific_risk_long_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    exchangeCD = Column(String(4))
    secShortName = Column(String(20))
    updateTime = Column(DateTime)
    SRISK = Column(Float(asdecimal=True))


class SpecificRiskShort(Base):
    __tablename__ = 'specific_risk_short'
    __table_args__ = (
        Index('specific_risk_short_Date_Code_uindex', 'Date', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    exchangeCD = Column(String(4))
    secShortName = Column(String(20))
    SRISK = Column(Float(asdecimal=True))
    updateTime = Column(DateTime)


class Strategy(Base):
    __tablename__ = 'strategy'
    __table_args__ = (
        Index('strategy_Date_strategyName_factor_uindex', 'Date', 'strategyName', 'factor', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    strategyName = Column(String(20), primary_key=True, nullable=False)
    factor = Column(String(50), primary_key=True, nullable=False)
    weight = Column(Float)
    source = Column(String(20))


class Universe(Base):
    __tablename__ = 'universe'
    __table_args__ = (
        Index('universe_Date_universe_Code_uindex', 'Date', 'universe', 'Code', unique=True),
    )

    Date = Column(DateTime, primary_key=True, nullable=False)
    Code = Column(Integer, primary_key=True, nullable=False)
    universe = Column(String(20), primary_key=True, nullable=False)


if __name__ == '__main__':

    from sqlalchemy import create_engine

    engine = create_engine('mysql+mysqldb://sa:We051253524522@rm-bp1psdz5615icqc0yo.mysql.rds.aliyuncs.com/test?charset=utf8')
    Base.metadata.create_all(engine)
