yakczh
V2EX  ›  PHP

lavarel 用 db migrate 建表的时候整型字段只能用 11 位?

  •  
  •   yakczh · Apr 28, 2014 · 2787 views
    This topic created in 4419 days ago, the information mentioned may be changed or developed.
    https://github.com/laravel/laravel/issues/2212#issuecomment-21608193

    $table->integer('publish_sex', 1)->default(0);// 性别
    $table->integer('publish_num', 2)->()->default(1);// 人数

    这样会报错
    第二个参数只能写成false, 但这样生成的sql字段长度是11位整型
    1 replies    2014-04-29 12:31:38 +08:00
    kukat
        1
    kukat  
       Apr 29, 2014
    $table->tinyInteger('length_1')
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   940 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:29 · PVG 04:29 · LAX 13:29 · JFK 16:29
    ♥ Do have faith in what you're doing.