New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

eltonlk/laravel-pg-schemas

Laravel package for managing postgres schemas.
99 2
Install
composer require eltonlk/laravel-pg-schemas:dev-master
PHP:>=5.4.0
License:MIT
Last Updated:Jul 24, 2014
Links: GitHub  ·  Packagist
Maintainer: eltonlk

Laravel PGSchema

Code Climate

With this package you can create, switch and drop postgres schemas.

Installation

Add the following to your composer.json:

"eltonlk/laravel-pg-schemas": "dev-master"

Add to your app.php file in the services providers section.

'providers' => array(
    ...

    'Eltonlk\LaravelPgSchemas\LaravelPgSchemasServiceProvider'
)

Usage

Assuming that you have your db configuration ready, meaning that your default connection is 'pgsql' and your pgsql credentials are setted in the usual way, you can use the next functions:

Create new Schema

PGSchema::create($schemaName);

Switch to Schema

if switchTo is call without arguments, it switches to the public schema (default)

PGSchema::switchTo($schemaName);

Drop Schema

PGSchema::drop($schemaName);

Migrate Schema

PGSchema::migrate($schemaName);

You can also tell which database connection.

PGSchema::migrate($schemaName, ['--database' => 'pgsql2']);

Related Packages

pacuna/schemas

Laravel package for managing postgresql schemas

66,032 41
racklin/pgschema

postgresql schemas for laravel 5

5,978 21
racklin/pkuuids

Using a UUID as PrimaryKey for laravel 5.3+

734 4
asmiarowski/laravel-postgres

Eloquent support for postgreSQL fields

38,407 15
codelieutenant/laravel-pgenum

Postgres Enums used in Laravel Migrations

3,069 5