=head1 NAME
-kmig-add - This will add the specified files to the mig tracking table
+mig-add - This will add the specified files to the mig tracking table
--headers (the default) and --no-headers are repeatable, and indicate whether
subsequent files have headers or not
--headers-file will automatically invoke --no-headers
-You'll need to invoke B<kmig-init> prior to using commands like B<kmig-add>
+You'll need to invoke B<mig-init> prior to using commands like B<mig-add>
=head1 SYNOPSIS
-B<kmig-add> [--no-headers|--headers|--headers-file <hfile>] <file> [file|--no-headers|--headers|--headers-file <hfile>] [...]
+B<mig-add> [--no-headers|--headers|--headers-file <hfile>] <file> [file|--no-headers|--headers|--headers-file <hfile>] [...]
=cut
=head1 NAME
-kmig-clean
+mig-clean
Attempts to invoke B<clean_csv> on the specified tracked file, placing the
output in [file].clean
=back
-You'll need to invoke B<kmig-iconv> or B<kmig-skip-iconv> prior to using commands
-like B<kmig-clean>
+You'll need to invoke B<mig-iconv> or B<mig-skip-iconv> prior to using commands
+like B<mig-clean>
=head1 SYNOPSIS
-B<kmig-clean> <file> [other arguments...]
+B<mig-clean> <file> [other arguments...]
=cut
my $data = KMig::status_this_file($file);
if (! $data->{'utf8_filename'}) {
- die "kmig-iconv or kmig-skip-iconv needed for UTF8 version of file: $file\n";
+ die "mig-iconv or mig-skip-iconv needed for UTF8 version of file: $file\n";
}
my $utf8_file = $data->{'utf8_filename'};
=head1 NAME
-kmig-env - This tool is for tracking and setting environment variables used by
-B<kmig> and its sub-tools.
+mig-env - This tool is for tracking and setting environment variables used by
+B<mig> and its sub-tools.
=head1 SYNOPSIS
-B<kmig-env> <create|use> <migration_schema>
+B<mig-env> <create|use> <migration_schema>
-B<kmig-env> <show> [migration_schema]
+B<mig-env> <show> [migration_schema]
-B<kmig-env> <clone> [orig_migration_schema] [new_migration_schema]
+B<mig-env> <clone> [orig_migration_schema] [new_migration_schema]
-B<kmig-env> <list>
+B<mig-env> <list>
-B<kmig-env> <help>
+B<mig-env> <help>
=head1 DESCRIPTION
-For most invocations, B<kmig-env> will either create or use a migration-specific
-file (~/.kmig/<migration_schema>.env) for setting the following environment
+For most invocations, B<mig-env> will either create or use a migration-specific
+file (~/.mig/<migration_schema>.env) for setting the following environment
variables:
=over 15
=item B<use> <schema>
This command will spawn a bash shell that executes the corresponding
-~/.kmig/<schema>.env script for setting up environment variables encoded during
+~/.mig/<schema>.env script for setting up environment variables encoded during
B<create>.
=item B<show> [schema]
-This command will show the contents of the corresponding ~/.kmig/<schema>.env
+This command will show the contents of the corresponding ~/.mig/<schema>.env
script, or, if no schema is specified, then it will list pertinent variables in
the current environment if they exist.
=item B<list>
-This command will list migration schemas found in ~/.kmig
+This command will list migration schemas found in ~/.mig
=item B<help>
pod2usage(-verbose => 2) if ! $ARGV[0];
my $migration_schema = $ARGV[1] || '';
-my $filename = "$HOME/.kmig/$migration_schema.env";
+my $filename = "$HOME/.mig/$migration_schema.env";
switch($ARGV[0]) {
case "--help" {
pod2usage(-verbose => 2);
case "clone" {
pod2usage(-verbose => 1) if ! $ARGV[2];
$migration_schema = $ARGV[2] || '';
- $filename = "$HOME/.kmig/$migration_schema.env";
+ $filename = "$HOME/.mig/$migration_schema.env";
mig_env_clone();
}
case "use" {
}
}
case "list" {
- opendir(my $dh, "$HOME/.kmig") || die "can't open $HOME/.kmig: $!";
+ opendir(my $dh, "$HOME/.mig") || die "can't open $HOME/.mig: $!";
while (readdir $dh) {
if (/^(.*)\.env$/) {
print "$1\n";
# create files and directories if needed
- mkdir "$HOME/.kmig";
+ mkdir "$HOME/.mig";
make_path($MIGGITDIR, { verbose => 1 });
`touch $MIGGITDIR/README`;
make_path($MIGWORKDIR, { verbose => 1 });
=head1 NAME
-kmig-iconv
+mig-iconv
Attempts to invoke B<iconv> on the specified tracked file, placing the
output in [file].iconv
=back
-You'll need to invoke B<kmig-add> prior to using commands like B<kmig-iconv>
+You'll need to invoke B<mig-add> prior to using commands like B<mig-iconv>
=head1 SYNOPSIS
-B<kmig-iconv> <file> [other arguments...]
+B<mig-iconv> <file> [other arguments...]
=cut
=head1 NAME
-kmig-init - This will add or recreate tracking tables for the B<kmig> toolset
-to the database specified by the current kmig environment.
+mig-init - This will add or recreate tracking tables for the B<mig> toolset
+to the database specified by the current mig environment.
-In practice, you should invoke 'kmig env use schema_name' prior to calling
+In practice, you should invoke 'mig env use schema_name' prior to calling
B<init>
=head1 SYNOPSIS
-B<kmig-init>
+B<mig-init>
-B<kmig-init> <help>
+B<mig-init> <help>
=cut
###############################################################################
sub loop_through_mig_sql_templates {
- print "Looping through kmig.d/sql/init/ templates\n";
+ print "Looping through mig.d/sql/init/ templates\n";
opendir my $dir, $mig_sql or die "Cannot open directory: $!";
my @files = sort readdir $dir;
closedir $dir;
foreach my $file (@files) {
if ($file =~ /.sql$/) {
print "executing $file:\n";
- system( $mig_bin . "kmig-sql", ('-e',"source $mig_sql$file") )
+ system( $mig_bin . "mig-sql", ('-e',"source $mig_sql$file") )
}
}
}
=head1 NAME
-kmig-remove - This will remove the specified files from the mig tracking table
+mig-remove - This will remove the specified files from the mig tracking table
-You'll need to invoke B<kmig-init> prior to using commands like B<kmig-remove>
+You'll need to invoke B<mig-init> prior to using commands like B<mig-remove>
=head1 SYNOPSIS
-B<kmig-remove> <file> [file] [...]
+B<mig-remove> <file> [file] [...]
=cut
=head1 NAME
-kmig-skip-iconv
+mig-skip-iconv
Allows you to either use an existing file named <file>.utf8 or a named
[utf8 file] as if it were the one created by mig-iconv
=head1 SYNOPSIS
-B<kmig-skip-iconv> <file> [utf8 file]
+B<mig-skip-iconv> <file> [utf8 file]
=cut
=head1 NAME
-kmig-sql
+mig-sql
A wrapper around the mysql client.
=head1 NAME
-kmig-status - This will show tracking information for either the specified files
+mig-status - This will show tracking information for either the specified files
or all tracked files if no argument is given.
-You'll need to invoke B<kmig-init> prior to using commands like B<mig-status>
+You'll need to invoke B<mig-init> prior to using commands like B<mig-status>
=head1 SYNOPSIS
-B<kmig-status> [file] [...]
+B<mig-status> [file] [...]
=cut