From 1e62938e10b5c7e9f91b09c53660ccb14e6004a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 5 Nov 2012 19:48:40 +0100 Subject: [PATCH] =?utf8?q?Doku=20f=C3=BCr=20dbupgrade=20--create?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- scripts/dbupgrade2_tool.pl | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/dbupgrade2_tool.pl b/scripts/dbupgrade2_tool.pl index 45e455652..3ed2186e8 100755 --- a/scripts/dbupgrade2_tool.pl +++ b/scripts/dbupgrade2_tool.pl @@ -73,6 +73,10 @@ dbupgrade2_tool.pl [options] for it\'s option \'-T\' are acceptable. --nodeps List all database upgrades that no other upgrade depends on + --create=tag Creates a new upgrade with the supplied tag. This + action accepts several optional other options. See + the option section for those. After creating the + upgrade file your \$EDITOR will be called with it. --apply=tag Applies the database upgrades \'tag\' and all upgrades it depends on. If \'--apply\' is used then the option \'--user\' must be used as well. @@ -87,7 +91,7 @@ dbupgrade2_tool.pl [options] and --dbpassword. --help Show this help and exit. - Options: + General Options: --user=name The name of the user configuration to use for database connectivity. --dbname=name Database connection options for the UTF-8 @@ -96,6 +100,16 @@ dbupgrade2_tool.pl [options] --dbuser=user --dbpassword=pw + Options for --create: + --type \'sql\' or \'pl\'. Defaults to sql. + --description The description field of the generated upgrade. + --encoding Encoding used for the file. Defaults to \'utf8\'. + Note: Your editor will not be told to open the file in + this encoding. + --depends Tags of upgrades which this upgrade depends upon. + Defaults to the latest stable release upgrade. + Multiple values possible. + END_HELP ; @@ -237,7 +251,7 @@ sub create_upgrade { my $filename = $params{filename}; my $dbupgrader = $params{dbupgrader}; - my $type = $params{type} || ''; + my $type = $params{type} || 'sql'; my $description = $params{description} || ''; my $encoding = $params{encoding} || 'utf-8'; my @depends = @{ $params{depends} }; @@ -270,6 +284,8 @@ sub create_upgrade { print $fh "$comment \@encoding: $encoding\n"; close $fh; + print "File $full_filename created.\n"; + system("\$EDITOR $full_filename"); exit 0; } -- 2.20.1