Mr. NH
Mr. NH

Reputation: 11

How can I make inherits of postgresql by migration in laravel 5.2?

I want yo make tables in postgresql with inherits, I foundes this http://packalyst.com/packages/package/thibaud-dauce/postgresql-schema form laravel 4.2, but it does not work whith laravel 5.2.

It shows me:

[Symfony\Component\Debug\Exception\FatalThrowableError] Fatal error: Class ThibaudDauce\PostgresqlSchema\PostgresqlSchemaServiceProvider' not found  

when i try with composer update.

Could you help me please?

Upvotes: 1

Views: 704

Answers (2)

Albert Tjornejoj
Albert Tjornejoj

Reputation: 460

You may run it:

DB::statement("ALTER TABLE capitals INHERIT cities;");

Upvotes: 2

Rishi Ramawat
Rishi Ramawat

Reputation: 43

You can pull in this package https://packagist.org/packages/rishi-ramawat/laravel-postgresql-inherit via composer like this for using it with Laravel 5.2.* & 5.3.* :

composer require "rishi-ramawat/laravel-postgresql-inherit ~2.1.0"

This is a package which I maintain and it currently supports Laravel 5.2.*, 5.3.* & 5.4.*

For Laravel 5.4.* you would have to do:

composer require "rishi-ramawat/laravel-postgresql-inherit ~2.2"

Please read the README of this package to find out more about the complete installation procedure.

Upvotes: 2

Related Questions