rishi-ramawat/laravel-postgresql-inherit
Add inheritance in postgresql tables
27,126
6
| Install | |
|---|---|
composer require rishi-ramawat/laravel-postgresql-inherit |
|
| Latest Version: | v2.2 |
| PHP: | >=5.4.0 |
| Laravel: | 5 |
| Older releases: | 4 |
| License: | MIT |
| Last Updated: | May 13, 2021 |
| Links: | GitHub · Packagist |
Maintainer: rishi-ramawat
PostgresqlSchema
Add inheritance in postgresql tables
Installation
PHP 5.4+ and Laravel 5.2+ are required.
For Laravel Versions 5.2.* & 5.3.*, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.1.0"
For Laravel Versions 5.4+, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.2"
Once PostgreSQL Schema is installed, you need to register the service provider. Open up config/app.php and add the following to the providers array.
RishiRamawat\PostgresSchema\PostgresqlSchemaServiceProvider::class,
Usage
In migration file when using a postgresql database, you can use the new method inherits():
Schema::create('cities', function(Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->double('population');
$table->integer('altitude')->comment('In Feet');
});
Schema::create('capitals', function(Blueprint $table) {
$table->string('state');
// Make capitals table inherits all the columns of its parent table, cities
$table->inherits('cities');
});
Related Packages
orptech/laravel-migration-partition
Laravel extensions that extends Illuminate to enable partitioned table creation...
32,931
36
nunomaduro/laravel-optimize-database
Publishes migrations that make your database production ready.
66,196
269
proai/laravel-super-migrations
This Laravel package is useful for big databases for a better migrations structu...
2,819
11
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v2.2 | >=5.4.0 | ~5.4 | MIT | |
| v2.1.1 | >=5.4.0 | ~5.2 | MIT | |
| 2.1 | >=5.4.0 | 5.2.* | MIT | |
| 2.0 | >=5.4.0 | 5.2.* | MIT | |
| v1.0 | >=5.4.0 | 4.2.* | MIT |