Skip to content

Cannot use Model first() and update() in table without primary key #1583

Description

@cobafesbuk

Describe the bug
When using a table without primary key, it's not possible to use first() command.
I found the reason is 'ORDER BY <tablename>.<primary key>' is always appended to the end of the query.
Emptying the $primaryKey does not fix the problem.

Similiar problem with update(). It works fine with insert().

I'm using the query builder for workaround for now.

CodeIgniter 4 version
CodeIgniter 4.0.0 alpha.2

Context

  • OS: Windows 10
  • Web server XAMPP 3.2.2
  • PHP version 7.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseIssues or pull requests that affect the database layer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions