zoukankan      html  css  js  c++  java
  • Phinx使用总结

    cd yourapp 

    php vendor/bin/phinx init . 初始化

    php vendor/bin/phinx create TableName 第一个字符必须大写

    $tableName = 'hangyeyinzi';
    if ($this->hasTable($tableName)) {
    $this->dropTable($tableName);
    }

    $this->table($tableName)
    ->addColumn('date', 'integer', ['limit' => 10, 'comment' => '日期代码格式20170624'])
    ->addColumn('yingshoulv', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '营业收入增长率(取3年均值)'])
    ->addColumn('jinglilv', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '净利润增长率(取3年均值)'])
    ->addColumn('jingzilv', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '净资产收益率'])
    ->addColumn('shouyibi', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '每股收益价格比(1/PE)'])
    ->addColumn('jingyingxianjinbi', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '每股经营性现金流价格比(每股现金流/现价)'])
    ->addColumn('guxilv', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '股息率'])
    ->addColumn('jingzibi', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '每股净资产价格比(1/PB)'])
    ->addColumn('hs300_ratio', 'decimal', ['precision' => 30, 'scale' => 15, 'comment' => '沪深300行业权重占比aindexhs300closeweight'])
    ->addColumn('hid', 'integer', ['limit' => 10, 'comment' => '行业代码'])
    ->create();

    php vendor/bin/phinx status -e Tag 查看指定环境的数据库状态

    php vendor/bin/phinx migrate -e Tag 根据脚本生产表结构到数据库里面

    php vendor/bin/phinx breakpoint -e Tag 打断点

    php vendor/bin/phinx rollback  -e Tag -t 20170623083322 回退指定点脚步

  • 相关阅读:
    C++ 如何判断所调用的重载函数
    C++ 入门5 类和动态内存分配(一)
    c#动态创建ODBC数据源
    设为首页,加入收藏,联系我们
    ASP.NET 2.0中CSS失效
    typedef的四个用途和两个陷阱(转)
    VC++实现应用程序对插件的支持(转)
    DOM无关事件
    How to Migrate from WCF Web API to ASP.NET Web API
    Using ASP.NET Web API with ASP.NET Web Forms
  • 原文地址:https://www.cnblogs.com/zhaoguangjie/p/7154084.html
Copyright © 2011-2022 走看看