therour / db-migrator
The Database migration based on laravel migration.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 1
Type:project
Requires
- php: ^7.2
- doctrine/dbal: ^2.10
- illuminate/config: ^6.0
- illuminate/console: ^6.0
- illuminate/container: ^6.0
- illuminate/contracts: ^6.0
- illuminate/database: ^6.0
- illuminate/filesystem: ^6.0
- illuminate/support: ^6.0
- symfony/console: ^4.3.4
- symfony/debug: ^4.3.4
- vlucas/phpdotenv: ^3.3
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ^9.1
This package is auto-updated.
Last update: 2024-03-07 13:34:58 UTC
README
Laravel migration only, built for separate project in case you are not using laravel as main framework but love to using its database migration,t
you may run php artisan make:migration
or php artisan migrate
within this package.
Installation
- Just Download zip or
- clone the repository to create this migration project
git clone git@github.com:therour/db-migrator.git
Configuration
- you should add configuration to
config.php
or you may use.env
just by creating the file.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
Usage
Create a migration file by running command
php artisan make:migration create_users_table
and then you can edit the migration file inside database
folder.
NB: see the documentation by laravel
Available commands
run php artisan list
to show all available commands.
-
db
php artisan db:seed
Seed the database with recordsphp artisan db:wipe
Drop all tables, views, and types
-
make
php artisan make:migration
Create a new migration filephp artisan make:seeder
Create a new seeder class
-
migrate
php artisan migrate:fresh
Drop all tables and re-run all migrationsphp artisan migrate:install
Create the migration repositoryphp artisan migrate:refresh
Reset and re-run all migrationsphp artisan migrate:reset
Rollback all database migrationsphp artisan migrate:rollback
Rollback the last database migrationphp artisan migrate:status
Show the status of each migration