Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loiYE-0008SM-MQ for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 08:18:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1loiYD-0006ui-DN for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 08:18:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loiYD-0006uZ-2U for pgadmin-hackers@lists.postgresql.org; Thu, 03 Jun 2021 08:18:01 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1loiY8-0001em-HR for pgadmin-hackers@postgresql.org; Thu, 03 Jun 2021 08:17:59 +0000 Received: by mail-ej1-x62f.google.com with SMTP id jt22so7941421ejb.7 for ; Thu, 03 Jun 2021 01:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wFbSqEy0Pb2FZSQE6b9HrtYEKthP44qt3YqWMZ/Rqc4=; b=BZVmFQi/xQiAqxxl8deMgVZFdh4pdeGDeEhCY4tu1LNM+sakqQPHvFX63LTfOjwebM S0auWwAANrPoUChy7lXhkpJmJsOMkgQ4drcabTPg5JNzKR3kNoqJEpIJo6cW0rnFQStS Trchg0zqn9BeMqUqHZynQ2UVayIMMuxb7FPPydCplGyDXWIGI9CBiIEO1yGTcdFacqEy 2MwBLHygUyx1B6o2s03kZ+DpdNBgWybrE3KulLDuQfwOYvaFDWsoQkcl6LecnhEgRJl+ v35wLnPcrLjw/b2lKzAkNPsfxus23rjl8IH8avpsGH2GDrCo45MYIv0rjzE04oSb+7HM uECw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wFbSqEy0Pb2FZSQE6b9HrtYEKthP44qt3YqWMZ/Rqc4=; b=UvbRk36+OEfKD53ODs20/DnPk/SbLY42HlIBh/++6JIeRHRkywjS5MmYQZ395DtkoI HG1wMG6FMW98uqeFzEGwnAou/RPLk5N6WzJjpCkKqTAbNbvYleVwd1miKA9oiMgsewoB 9uO8+rL6kW/VOMtxoxkxZ0ajqDTSqOHibjJSm020oX+C7EJldzXVsOZg2XSdWVwue9oM mnlywVfZX4ea58lGzxZc/hkKjByJ+H+QqdPbizvIoOfvkXJzbnIoPL05FqoWvjSd0X6U MCOZQfAtT1Ang7As21AoZdQwUoYNBVRAkjnadfXZaD9WcOYzUWGX1PPMFr5Rhl3QIIjn OsZw== X-Gm-Message-State: AOAM532J2fVvNiPVqwDnwPU9DR7yAmAyCK6FutOttshBy+XFZvQNi2xK rJV+8nVHlCgZvrviMv0O+qgQk/7ajco2UwriSIC1/Q== X-Google-Smtp-Source: ABdhPJxUQq4n/mcN4R0b9DWqIqCJf9YEN8Kft3J+y1CTvGc7dECU1EgJE9a5IxV5ptD+ZAoTpOYxy5koZtD4XCeU2Pw= X-Received: by 2002:a17:906:4e91:: with SMTP id v17mr8897782eju.119.1622708274582; Thu, 03 Jun 2021 01:17:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Thu, 3 Jun 2021 09:17:41 +0100 Message-ID: Subject: Re: [pgAdmin][RM-6460]: Need a mechanism to detect a corrupt/broken config DB file. To: Nikhil Mohite Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000047e03d05c3d8366e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000047e03d05c3d8366e Content-Type: text/plain; charset="UTF-8" Hi On Thu, Jun 3, 2021 at 7:39 AM Nikhil Mohite wrote: > Hi Hackers, > > Please find the attached patch for RM-6460 > : Need a mechanism to detect > a corrupt/broken config DB file. > > 1. Added checks if all tables added in the model are present in SQLite DB > or not. > 2. If migrations fail it will backup older file and try migrations with > the newly created file. > (User will get notification on UI for the location of the backup file and > newly created.) > 3. If the user deleted any table from SQLite DB pgAdmin will not run on > the next restart and it will add the missing table list in the logs. > Surely if any tables have been deleted, it'll fail the check in point 1? -- Dave Page Blog: https://pgsnake.blogspot.com Twitter: @pgsnake EDB: https://www.enterprisedb.com --00000000000047e03d05c3d8366e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Jun 3, 2021 at 7:39 AM Nikhil M= ohite <nikhil.mohite@e= nterprisedb.com> wrote:
H= i Hackers,

Please find the attached patch for=C2=A0RM-6460= :=C2=A0 Need a mechanism to detect a corrupt/broken config DB file.

1. Added checks if all tables added in the model are = present in SQLite DB or not.
2. If migrations fail it will backup= older file and try migrations with the newly created file.=C2=A0
(User will get notification on UI=C2=A0for the location=C2=A0of the backup= file and newly created.)
3. If the user deleted any table from S= QLite DB pgAdmin will not run on the next restart and it will add the missi= ng table list in the logs.

Sure= ly if any tables have been deleted, it'll fail the check in point 1?
=C2=A0
--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake<= br>
EDB: http= s://www.enterprisedb.com

--00000000000047e03d05c3d8366e--