V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yakczh
V2EX  ›  PHP

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

  •  
  •   yakczh · 2014-04-28 21:27:07 +08:00 · 2306 次点击
    这是一个创建于 3651 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    2014-04-29 12:31:38 +08:00
    kukat
        1
    kukat  
       2014-04-29 12:31:38 +08:00
    $table->tinyInteger('length_1')
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   984 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:09 · PVG 04:09 · LAX 13:09 · JFK 16:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.