• Jacob Vosmaer's avatar
    Empty the database during Postgres backup restore · 8fe10e64
    Jacob Vosmaer authored
    The expected behavior during a GitLab backup restore is to overwrite
    existing database data. This works for MySQL because the output of
    mysqldump contains 'DROP TABLE IF EXISTS' statements. pg_dump on the
    other hand assumes that one will restore into an empty database. When
    this is not the case, during the restore with psql some of the data will
    be skipped if existing data is 'in the way'. By first invoking `rake
    db:schema:load` during a Postgres GitLab backup restore, we make sure
    that all important data is correctly restored.
    8fe10e64
database.rb 2.16 KB