Move database creation to bin/dbcreate.pl.
Remove install/* Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
4ad63fcb4e
commit
9b6bf3e194
|
@ -1,6 +1,6 @@
|
|||
#! /usr/bin/perl
|
||||
#
|
||||
# install.pl
|
||||
# dbcreate.pl
|
||||
#
|
||||
# This script will create database tables as necessary.
|
||||
#
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
BEGIN {
|
||||
use File::Basename;
|
||||
# we're in .../install, so our module is in ../lib
|
||||
# we're in .../bin, so our module is in ../lib
|
||||
push(@INC, dirname($0).'/../lib');
|
||||
}
|
||||
use strict;
|
||||
|
@ -231,7 +231,7 @@ sub CreateTable {
|
|||
};
|
||||
my $DBQuery = $DBHandle->prepare($DBCreate{$Table});
|
||||
$DBQuery->execute() or
|
||||
&Bleat(2, sprintf("Can't create table %s in database %s: %s%\n",$Table,
|
||||
&Bleat(2, sprintf("Can't create table %s in database %s: %s\n",$Table,
|
||||
$Conf{'DBDatabase'},$DBI::errstr));
|
||||
printf("Database table %s.%s created succesfully.\n",
|
||||
$Conf{'DBDatabase'},$Conf{$Table});
|
||||
|
@ -261,11 +261,11 @@ __END__
|
|||
|
||||
=head1 NAME
|
||||
|
||||
install - installation script
|
||||
dbcreate - database creation script
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<install> [B<-Vh> [--update I<version>] [B<--conffile> I<filename>]
|
||||
B<dbcreate> [B<-Vh> [--update I<version>] [B<--conffile> I<filename>]
|
||||
|
||||
=head1 REQUIREMENTS
|
||||
|
||||
|
@ -273,11 +273,12 @@ See L<doc/README>.
|
|||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This script will create database tables as necessary and configured.
|
||||
This script will create a database and database tables as necessary
|
||||
and configured.
|
||||
|
||||
=head2 Configuration
|
||||
|
||||
B<install> will read its configuration from F<newsstats.conf> which should
|
||||
B<dbcreate> will read its configuration from F<newsstats.conf> which should
|
||||
be present in etc/ via Config::Auto or from a configuration file submitted
|
||||
by the B<--conffile> option.
|
||||
|
||||
|
@ -309,7 +310,7 @@ Load configuration from I<filename> instead of F<newsstats.conf>.
|
|||
|
||||
=over 4
|
||||
|
||||
=item F<install/install.pl>
|
||||
=item F<bin/dbcreate.pl>
|
||||
|
||||
The script itself.
|
||||
|
|
@ -20,6 +20,7 @@ NewsStats 0.3.0 (unreleased)
|
|||
Change caption handling, update documentation accordingly.
|
||||
* Fix call to GetMaxLength() in cliservstats.
|
||||
* Fix typos in documentation, update sample config file.
|
||||
* Move database creation from install/install.pl to bin/dbcreate.pl
|
||||
|
||||
NewsStats 0.2.0 (2025-05-10)
|
||||
* Redo directory structure:
|
||||
|
|
|
@ -70,9 +70,9 @@ INSTALLATION INSTRUCTIONS
|
|||
* Setup your database server with a username, password and
|
||||
database matching the NewsStats configuration (see 2 a).
|
||||
|
||||
* Start the installation script:
|
||||
* Start the database creation script:
|
||||
|
||||
# install/install.pl
|
||||
# bin/dbcreate.pl
|
||||
|
||||
It will setup the necessary database tables and display some
|
||||
information on the next steps.
|
||||
|
|
Loading…
Reference in a new issue