Giter Club home page Giter Club logo

laravel-pg-schemas's Introduction

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']);

laravel-pg-schemas's People

Contributors

eltonlk avatar

Stargazers

Aleksey Kazakov avatar Joe2 Palala avatar

Watchers

 avatar James Cloos avatar Menjanahary avatar Vítor Arjol avatar Joe2 Palala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.