【问题标题】:How to make sure a table is indexed by a certain column when using RedBean PHP ORM?使用 RedBean PHP ORM 时如何确保表被某个列索引?
【发布时间】:2012-04-01 03:02:31
【问题描述】:

我有一个名为“帐户”的实体,它有一个用户名列,我想以此作为索引,因为我将在登录时使用它来查找用户名。

我如何告诉 redbean orm 我希望该表具有列“用户名”以进行索引以便更快地查找?我是否必须手动更新数据库而不是通过 redbean orm?

【问题讨论】:

    标签: php orm indexing redbean


    【解决方案1】:

    我想这就是你所追求的:

    R::$writer->addIndex('account','userindex','username');
    

    【讨论】:

    • 如何添加多列非唯一索引(addUniqueIndex 不起作用)?
    猜你喜欢
    • 1970-01-01
    • 2011-06-07
    • 2013-02-26
    • 1970-01-01
    • 2016-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多