Download the PHP package soft4good/poorman-migrations without Composer

On this page you can find all versions of the php package soft4good/poorman-migrations. 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 poorman-migrations

Poorman Migrations

A lightweight, standalone migrations manager for MySQL databases with support for multiple environments. Featuring base schemas and seeds.

Installation

This will add a .env file and a db/ directory to your project root.

If you have multiple environments you can create env files for each like: .env.development, .env.staging, .env.production, etc...

IMPORTANT: Make sure to .gitignore your .env files so you don't leak sensitive info to the repository.

The db/ directory contains three subdirs:

db/migrations/

Migrations are SQL scripts with instructions to modify the database structure.

Migration filename syntax: <timestamp>_<name>.sql

Auto-generate migrations using the gen:migration task (see usage below)

NOTE: You may be tempted to add INSERT queries (seed data) on the migration scripts. PLEASE DON'T DO THIS, seed data for the specific environments should be placed in the SQL scripts found in the seeds/ directory. On reset operations, the migration scripts are ran immediately after the database structure is reset and there is no data, placing seed data in these files may fail foreign key checks rendering the migration invalid.

db/seeds/

Seeds are SQL scripts with instructions to populate your database with seed data.

Here you can add seed data by environment, the default is local (local.sql).

db/schemas

Schemas are the base/initial structure of your database, these scripts are supposed to contain structure-only code.

Here you can add schemas by environment, the default is local (local.sql).

Usage

Poorman Migrations will expose vendor/bin/poorman-migrations. Usage is as follows:

Syntax:

Where:

\<task>: setup | migrate | reset | init | seed | gen:migration

\<environment>: development | staging | production | etc...

\<artifact_name>: Required for <task=gen:migration>, the name of the migration (e.g. 'new_user_fields')

setup

You should run this task as part of the installation step. It will interactively create a .env file with the credentials to the database provided by you and the base db directory.

init

Loads the DB schema by executing the sql script on db/schemas specific to the specified environment, default is local.

So for example:

will run db/schemas/local.sql

while:

will run db/schemas/development.sql.

seed

Loads database seeds from the db/seeds directory for the specified environment, default is local.

So for example:

will run db/seeds/local.sql

while:

will run db/seeds/development.sql.

migrate

Will execute database migrations found in the db/migrations directory. Migrations are ran in order taking into account the timestamp in the filename.

We keep track of already migrated scripts by looking at the schema_migrations table in the database, this table is created by the migrate task if it doesnt exist.

e.g.

You can also specify an environment to migrate as with the other tasks.

gen:migration

This task will create an empty migration file with the artifact_name specified.

e.g.

This example will create a file db/migrations/<timestamp>_create_users_table.sql.

You can now add your sql statements to this SQL file and it will be executed the next time you run the migrate task.

reset

Doing a reset will run these tasks in the following order:


All versions of poorman-migrations with dependencies

PHP Build Version
Package Version
Requires vlucas/phpdotenv Version ^2.5
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 soft4good/poorman-migrations contains the following files

Loading the files please wait ....