2017 © Pedro Peláez
 

yii2-extension yii2-db

Database extensions

image

dmstr/yii2-db

Database extensions

  • Wednesday, July 18, 2018
  • by schmunk
  • Repository
  • 9 Watchers
  • 15 Stars
  • 70,088 Installations
  • PHP
  • 10 Dependents
  • 0 Suggesters
  • 10 Forks
  • 3 Open issues
  • 60 Versions
  • 6 % Grown

The README.md

Yii 2 Database Toolkit

Latest Stable Version Total Downloads License, (*1)

About

dmstr\db\behaviors\HydratedAttributes

Retrieves all eager loaded attributes of a model including relations. Once the extension is installed, simply use it in your code by accessing the corresponding classes by their full namespaced path., (*2)

dmstr\db\mysql\FileMigration

runs database migrations from sql files, (*3)

  • Generic database exentsions
    • Hydrated Attributes
  • Database extensions for MySQL
    • File Migration
    • Mysql dump/export/import console controller
  • RBAC migrations moved to https://github.com/dmstr/yii2-rbac-migration since 2.0.0
  • Active record access classes moved to https://github.com/dmstr/yii2-active-record-permissions since 2.0.0

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

composer require --prefer-dist dmstr/yii2-db "*"

or add, (*6)

"dmstr/yii2-db": "*"

to the require section of your composer.json file., (*7)

Configuration

dmstr\console\controllers

Include it in your console configuration, (*8)

   'controllerMap' => [
        'db'         => [
            'class' => 'dmstr\console\controllers\MysqlController',
            'noDataTables' => [
                'app_log',
                'app_session',
            ]
        ],
    ],

Usage

Commands

yii migrate ...

Create a file migration class, (*9)

yii migrate/create \
    --templateFile='@vendor/dmstr/yii2-db/db/mysql/templates/file-migration.php' init_dump

yii db ...

DESCRIPTION

MySQL database maintenance command for current (db) connection


SUB-COMMANDS

- db/create               Create schema
- db/destroy              Remove schema
- db/dump                 Dump schema (all tables)
- db/export               Export tables (INSERT only)
- db/import               Import from file to database and flush cache
- db/index (default)      Displays tables in database
- db/wait-for-connection

To see the detailed information about individual sub-commands, enter:

  yii help <sub-command>

Show help, (*10)

yii help db

Examples

Dry-run command (not available for all commands), (*11)

yii db/create root secret -n

Destroy database, (*12)

yii db/destroy root secret

Dump all tables, (*13)

yii db/dump -o /dumps

Dump from different connection, exclude logging tables, (*14)

yii db/dump -o /dumps \
  --db=dbReadonly \
  --noDataTables=app_audit_data,app_audit_entry,app_audit_error,app_audit_javascript,app_audit_mail

Dump from secondary connection, import into primary (default), (*15)

yii db/dump -o /dumps   \
    --db=dbReadonly   \
    --noDataTables=app_audit_data,app_audit_entry,app_audit_error,app_audit_javascript,app_audit_mail \
 | xargs yii db/import --interactive=0

Built by dmstr, (*16)

The Versions

18/07 2018

dev-feature/access-control

dev-feature/access-control

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

18/07 2018

1.0.0-alpha1

1.0.0.0-alpha1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

26/06 2018

dev-master

9999999-dev

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

26/06 2018

0.10.1

0.10.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

29/05 2018

dev-feature/model-import-export

dev-feature/model-import-export

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

08/05 2018

0.10.0

0.10.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

02/05 2018

0.10.0-beta3

0.10.0.0-beta3

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

27/04 2018

0.10.0-beta2

0.10.0.0-beta2

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

10/04 2018

0.10.0-beta1

0.10.0.0-beta1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

29/01 2018

0.9.4

0.9.4.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

16/10 2017

0.9.3

0.9.3.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

13/10 2017

0.9.2

0.9.2.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

14/08 2017

0.9.1-rc1

0.9.1.0-RC1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

14/08 2017

0.9.1

0.9.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

13/07 2017

0.9.0

0.9.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

18/04 2017

0.8.11

0.8.11.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

03/04 2017

0.8.10

0.8.10.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

03/04 2017

0.8.10-rc1

0.8.10.0-RC1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

31/03 2017

0.8.9

0.8.9.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

31/03 2017

0.8.8

0.8.8.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

21/03 2017

0.8.7

0.8.7.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

16/03 2017

0.8.6

0.8.6.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

16/03 2017

0.8.5

0.8.5.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

15/03 2017

0.8.4

0.8.4.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

14/03 2017

0.8.3

0.8.3.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

09/03 2017

0.8.2

0.8.2.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

08/03 2017

0.8.1

0.8.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

24/02 2017

0.8.0

0.8.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

17/02 2017

0.8.0-rc4

0.8.0.0-RC4

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

17/02 2017

0.8.0-rc3

0.8.0.0-RC3

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

15/02 2017

0.8.0-rc2

0.8.0.0-RC2

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

08/02 2017

0.8.0-rc1

0.8.0.0-RC1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

30/01 2017

0.7.8

0.7.8.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

29/11 2016

0.7.7

0.7.7.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

10/11 2016

0.7.7-rc2

0.7.7.0-RC2

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

28/10 2016

0.7.7-rc1

0.7.7.0-RC1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

06/10 2016

0.7.7-beta1

0.7.7.0-beta1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

27/09 2016

0.7.6

0.7.6.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

26/08 2016

dev-feature/require

dev-feature/require

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

26/08 2016

0.7.5

0.7.5.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

06/07 2016

0.7.4

0.7.4.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

28/06 2016

0.7.3

0.7.3.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

28/06 2016

0.7.2

0.7.2.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

28/06 2016

0.7.1

0.7.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

26/06 2016

0.7.0

0.7.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

23/06 2016

dev-feature/updated-tests

dev-feature/updated-tests

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

21/06 2016

0.6.2

0.6.2.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

20/06 2016

0.6.1

0.6.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

19/06 2016

0.6.0

0.6.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

17/06 2016

0.5.2

0.5.2.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

15/06 2016

0.5.1

0.5.1.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

15/06 2016

0.5.0

0.5.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

08/06 2016

0.4.0

0.4.0.0

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

12/05 2016

0.4.0-beta2

0.4.0.0-beta2

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

12/05 2016

0.4.0-beta1

0.4.0.0-beta1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

30/03 2016

0.4.0-alpha1

0.4.0.0-alpha1

Database extensions

  Sources   Download

BSD-3-Clause

The Requires

 

database extension yii2 db

21/12 2015

0.3.0

0.3.0.0

Database extensions

  Sources   Download

BSD-3-Clause

database extension yii2 db

13/01 2015

0.2.0

0.2.0.0

Database extensions

  Sources   Download

BSD-3-Clause

database extension yii2 db

27/11 2014

0.1.1

0.1.1.0

Database extensions

  Sources   Download

BSD-3-Clause

database extension yii2 db

14/11 2014

0.1.0

0.1.0.0

Database extensions

  Sources   Download

BSD-3-Clause

database extension yii2 db