Download the PHP package aldoggutierrez/laravel-schema-manager without Composer
On this page you can find all versions of the php package aldoggutierrez/laravel-schema-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aldoggutierrez/laravel-schema-manager
More information about aldoggutierrez/laravel-schema-manager
Files in aldoggutierrez/laravel-schema-manager
Package laravel-schema-manager
Short Description Manage PostgreSQL schemas in Laravel applications
License MIT
Homepage https://github.com/55823142-aldoggutierrez/laravel-schema-manager
Informations about the package laravel-schema-manager
Laravel Schema Manager
Manage PostgreSQL schemas in Laravel applications with ease. Move tables between schemas while preserving foreign keys and relationships. Generate versioned schema migrations and dump the full database schema to a SQL file.
Installation
You can install the package via composer:
Configuration
Publish the configuration file:
Available options in config/schema-manager.php:
These are the contents of the published config file:
Usage
Move a table between schemas
List tables in schemas
Generate a schema migration
Creates a versioned migration file that moves a table between schemas using
ALTER TABLE … SET SCHEMA. The generated migration also handles any sequences
attached to the table.
The generated file is placed in database/migrations/ with a timestamped name
such as 2024_01_01_120000_move_orders_from_external_to_public.php. It contains
both up() and down() methods so the move is fully reversible.
Dump the database schema
Exports the PostgreSQL schema (DDL) for one or more schemas to a SQL file using
pg_dump. Useful for keeping a schema snapshot in version control and for
seeding fresh environments without running every historical migration.
Requires
pg_dumpto be installed and accessible on$PATH.
Options
| Option | Default | Description |
|---|---|---|
--database |
pgsql |
Laravel database connection to use |
--schemas |
connection search_path or public |
Comma-separated list of schemas to dump |
--path |
database/schema/{connection}-schema.sql |
Output file path |
--prune |
— | Delete all files in database/migrations/ after the dump |
The command writes two sections to the output file:
- Schema-only DDL (
pg_dump --schema-only) for all requested schemas. - Data rows from the
migrationstable so Laravel knows which migrations have already been run.
Features
✅ Move tables between PostgreSQL schemas ✅ Automatically handles foreign key constraints ✅ Preserves all relationships (ON UPDATE/DELETE rules) ✅ Cross-schema foreign key support ✅ Dry-run mode to preview changes ✅ Transaction-based for safety ✅ List tables and schemas ✅ Generate reversible schema migration files ✅ Dump the full schema (DDL + migrations data) to a SQL file
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Aldoggutierrez
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-schema-manager with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0