Skip to content

How to place an Auto-increment id in v3.1 #464

@sharan1

Description

@sharan1

when we updated factory muffin from v2.1 to v3.1

For auto-incrementing ids, we used to use the following function:

function () {
        static $last;
         if ($last === null) {
             return $last = 1;
         }
         return ++$last;
}

But after upgrading the same function always started returning 1, resulting in errors for duplication of primary key in our test database.

Any idea what could be the issue and how to resolve it?

Originally posted by @sharan1 in #382 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions