Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • stork stork
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 216
    • Issues 216
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • storkstork
  • Issues
  • #676

Closed
Open
Created Dec 16, 2021 by Marcin Siodelski@marcinMaintainer

[ISC-support #19985] Fix database migration in Stork 1.0.0

The database migration 37, among other things, does this:

...
DELETE FROM host;
...
-- Add a missing foreign key to host table.
ALTER TABLE local_host
    ADD CONSTRAINT local_host_to_host_id FOREIGN KEY (host_id)
        REFERENCES host (id) MATCH SIMPLE
            ON UPDATE CASCADE
            ON DELETE CASCADE;

The first statement relies on the presence of the foreign key which is added later. This causes constraint violation issues when people migrate databases that include host reservations. The order of these operations must be swapped.

Current workaround for this issue is to manually run:

DELETE FROM local_host;

using psql.

Edited Dec 16, 2021 by Everett Fulton
Assignee
Assign to
Time tracking