From: Ian Jackson Subject: Re: [OSSTEST PATCH 4/7] Schema: Introduce mg-schema-create Date: Thu, 10 Dec 2015 15:19:10 +0000 Message-ID: <22121.38894.566485.105360@mariner.uk.xensource.com> References: <1449755513-4166-1-git-send-email-ian.jackson@eu.citrix.com> <1449755513-4166-5-git-send-email-ian.jackson@eu.citrix.com> <1449760127.9759.73.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a730B-000052-5j for xen-devel@lists.xenproject.org; Thu, 10 Dec 2015 15:19:27 +0000 In-Reply-To: <1449760127.9759.73.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [OSSTEST PATCH 4/7] Schema: Introduce mg-schema-create"): > On Thu, 2015-12-10 at 13:51 +0000, Ian Jackson wrote: > > There is a fair amount of option parsing clobber here that will be > > relevant shortly. > > How dangerous is this script if you just run it e.g. without with_test? Not particularly: (osstest)mariner:testing.git> OSSTEST_CONFIG=/u/iwj/.xen-osstest/config:local-config.test-database_iwj ./mg-schema-create Populating database... SET SET SET SET SET SET SET SET SET psql:schema/initial.sql:28: ERROR: relation "flights" already exists (osstest)mariner:testing.git> > Specifically, would it nuke an existing database? So, no. If we ever delete the `flights' table in a schema update, this script might recreate it before falling over later. So if we do that we ought to add a safety catch to mg-schema-create, for example to have it check that no schema updates have yet been applied. Ian.