Package Data | |
---|---|
Maintainer Username: | eltonlk |
Maintainer Contact: | eltonlk@gmail.com (Elton Luis Kolling) |
Package Create Date: | 2014-07-03 |
Package Last Update: | 2014-07-24 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-23 03:21:16 |
Package Statistics | |
---|---|
Total Downloads: | 89 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 5 |
Total Forks: | 0 |
Total Open Issues: | 0 |
With this package you can create, switch and drop postgres schemas.
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'
)
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:
PGSchema::create($schemaName);
if switchTo is call without arguments, it switches to the public schema (default)
PGSchema::switchTo($schemaName);
PGSchema::drop($schemaName);
PGSchema::migrate($schemaName);
You can also tell which database connection.
PGSchema::migrate($schemaName, ['--database' => 'pgsql2']);