{"id":23467609,"url":"https://github.com/askbot/django-postgresql-fix-sequences","last_synced_at":"2025-04-14T12:33:16.070Z","repository":{"id":5146136,"uuid":"6313350","full_name":"ASKBOT/django-postgresql-fix-sequences","owner":"ASKBOT","description":null,"archived":false,"fork":false,"pushed_at":"2015-06-09T22:05:03.000Z","size":131,"stargazers_count":9,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T01:50:29.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"blackfizz/EazeGraph","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ASKBOT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-20T20:23:27.000Z","updated_at":"2024-11-28T16:30:46.000Z","dependencies_parsed_at":"2022-07-05T17:34:53.886Z","dependency_job_id":null,"html_url":"https://github.com/ASKBOT/django-postgresql-fix-sequences","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASKBOT%2Fdjango-postgresql-fix-sequences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASKBOT%2Fdjango-postgresql-fix-sequences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASKBOT%2Fdjango-postgresql-fix-sequences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ASKBOT%2Fdjango-postgresql-fix-sequences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ASKBOT","download_url":"https://codeload.github.com/ASKBOT/django-postgresql-fix-sequences/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248881920,"owners_count":21176943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-24T12:38:08.265Z","updated_at":"2025-04-14T12:33:16.038Z","avatar_url":"https://github.com/ASKBOT.png","language":"Python","readme":"django-postgresql-fix-sequences\n===============================\nFixes sequences in postgresql to help prevent the \nduplicate primary key errors.\n\nThe command needs to be run with all other connections to the database\nclosed, so that there is no competition for the access to the sequences.\n\nExamples:\n\n    python manage.py postgres_fix_sequences --auto\n    python manage.py postgres_fix_sequences --minvalue 1 --increment 2\n    python manage.py postgres_fix_sequences --tables=auth_user --auto\n\nThe fixes can be applied either to all tables that are part of a \ndjango project, or to specifically selected tables, in which case\nthose tables do not have to be part of any django application.\n\nSequences can be fixed either automatically (where appropriate)\nor by manually setting the sequence parameters\n(supported values are minvalue and increment -\nas defined in CREATE SEQUENCE postgresql command).\n\nFix sequences automatically with the `--auto` flag\n--------------------------------------------------\nSequences will be repaired automatically.\nUse this if you know that this is possible and safe,\ne.g. that the starting value and the step of the sequences\nare correct, but the current value may be off.\n\nNote that either `--auto` or `--min-value` together with `--increment`\nmust be given.\n\nThe command takes current value in the sequence\n`currval()` and the next value `netxval()`\nand determines step in the sequence.\n\nFinds the highest id number (let's call it `max_id`)\nfor the rows matching the given sequence,\nif id number is greater or equals to what is returned by the `nextval()`\nwe need to set the current value with `setval()`\nto exactly what we found for `max_id`.\n\nSpecify minimum value and the increment for the sequence\n--------------------------------------------------------\nIf you cannot use the `--auto` method, then you have to specify\n`--minvalue` and `--increment` for the sequence manually.\nBoth should be positive integers.\n\nSpecify tables manually with --tables option\n-----------------------------------------------\nFor example, with:\n\n    python manage.py postgres_fix_sequences --tables=auth_user,auth_group\n\nonly tables `auth_user` and `auth_group` will be fixed.\n\nNote that with the --tables table names do not have to be\npart of a django project.\n\n\nCopyright: 2012 Askbot SpA, Vina del Mar, Chile.\nAuthor: Evgeny Fadeev, evgeny.fadeev@gmail.com\nLicense: MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskbot%2Fdjango-postgresql-fix-sequences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskbot%2Fdjango-postgresql-fix-sequences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskbot%2Fdjango-postgresql-fix-sequences/lists"}