Download the PHP package schmunk42/database-command without Composer

On this page you can find all versions of the php package schmunk42/database-command. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package database-command

database-command

Yii command to create database migrations from existing schema. Migration classes are created in application runtime folder.

Requirements

Features

Download

Get it from github and place it into your application.

Or install it via composer require schmunk42/database-command.

Configuration

config/console.php

'commandMap' => array(
    'database' => array(
        'class' => 'vendor.schmunk42.database-command.EDatabaseCommand',
    ),
)

Note: You may have to replace vendor.schmunk42.database-command.EDatabaseCommand with the acutal installation path.

Usage

Run the command...

./yiic database

... to show the help page

dump [<name>] [--prefix=<table_prefix,...>] [--dbConnection=<db>]
        [--createSchema=<1|0>] [--insertData=<1|0>] [--foreignKeyChecks=<1|0>]
        [--ignoreMigrationTable=<1|0>] [--truncateTable=<0|1>]
        [--insertAutoIncrementValues=<1|0>] [--migrationPath=<application.runtime>]
Param Default Info
name dump migration class name
--prefix dump only tables with given prefix
(specify multiple prefixes separated by commas)
--createSchema 1 whether to create tables
--insertData 1 whether to create insert statements
--foreignKeyChecks 1 set to 0 to disable foreign key checks
--truncateTable 0 whether to remove all records from the table first
--dbConnection db application component to use
--migrationPath application.runtime default dump folder
--ignoreMigrationTable 1 whether to ignore to migration table
--insertAutoIncrementValues 1 whether to include values from auto-increment column

Example

To create a migration from an existing application database schema, define an alternative database component in your application, e.g. db-production.

This example shows data dumping, removes all data (truncate tables) and omits foreign key checks:

 ./yiic database dump p3_replace_data \
   --prefix=Auth,Rights,usr,p3 --createSchema=0 \
   --foreignKeyChecks=0 --truncateTable=1

Separate schema and data:

 ./yiic database dump my_schema --insertData=0
 ./yiic database dump my_data --createSchema=0

Replace your whole data with data from dbProduction:

 ./yiic database dump replace_data \
   --truncateTable=1 --foreignKeyChecks=0 \
   --createSchema=0 --dbConnection=dbProduction

The following command dumps all tables starting with p3_media and omits the schema create statements:

./yiic database dump p3media_no_schema_production \
--prefix=p3_media --createSchema=0 --dbConnection=dbProduction

Resources


All versions of database-command with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
yiisoft/yii Version >=1.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schmunk42/database-command contains the following files

Loading the files please wait ....