Skip to content

update the sequences for models which are migrating IDs of objects #56

@krzysztof

Description

@krzysztof

After DB dumps loading, the PK sequence generator should be reset to the highest PK in the table.

This can be done for users like: SELECT setval('accounts_user_id_seq', (SELECT MAX(id)+1 FROM accounts_user));.

This problem will affect all models which are loaded along with the old integer PKs, e.g., most models which use this utility function: https://github.com/inveniosoftware/invenio-migrator/blob/master/invenio_migrator/tasks/utils.py#L35-L37

Access.ActionUsers
AccessRequests.Link
AccessRequests.Request
Accounts.User
Communities.FeaturedCommunity
OAuth2Server.Token
OAuthClient.RemoteAccount

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions