jumper423/laravel-postgresql-inherit

在postgresql表中添加继承

2.1 2016-06-16 12:33 UTC

This package is not auto-updated.

Last update: 2024-09-20 21:22:43 UTC


README

Software License

在postgresql表中添加继承

安装

需要PHP 5.4+ 和 Laravel 5.2+。

要获取最新版本的PostgreSQL模式,只需在您的composer.json文件中要求"jumper423/laravel-postgresql-inherit": "2.*"。然后您需要运行composer installcomposer update来下载它并更新自动加载器。

一旦安装了PostgreSQL模式,您需要注册服务提供者。打开app/config/app.php并将以下内容添加到providers键。

  • 'ThibaudDauce\PostgresqlSchema\PostgresqlSchemaServiceProvider'

使用方法

当使用postgresql数据库时,在迁移文件中,您可以使用新方法addInheritedTable

<?php

Schema::create('test', function(Blueprint $table) {

  $table->increments('id');
  $table->addInheritedTable('users');
});