|
1 | 1 | # artisan-migrator
|
2 | 2 |
|
3 |
| -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 |
| 3 | +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 |
4 | 4 | you may run `php artisan make:migration` or `php artisan migrate` within this package.
|
5 | 5 |
|
6 | 6 | ## Installation
|
7 |
| -- Just [Download zip](https://github.com/therour/artisan-migrator/archive/master.zip) **or** |
8 |
| -- clone the repository to create this migration project `git clone [email protected]:therour/artisan-migrator.git` |
| 7 | +- Just [Download zip](https://github.com/therour/db-migrator/archive/master.zip) **or** |
| 8 | +- clone the repository to create this migration project `git clone [email protected]:therour/db-migrator.git` |
9 | 9 |
|
10 | 10 | ## Configuration
|
11 |
| -- you should add configuration to `config.php` if you are not using `mysql` connection. (currently only providing default configuration for mysql) |
12 |
| -- you may use `.env` just by creating the file. |
| 11 | +- you should add configuration to `config.php` or you may use `.env` just by creating the file. |
| 12 | +```yaml |
| 13 | +DB_CONNECTION=mysql |
| 14 | +DB_HOST=127.0.0.1 |
| 15 | +DB_PORT=3306 |
| 16 | +DB_DATABASE=test |
| 17 | +DB_USERNAME=root |
| 18 | +DB_PASSWORD= |
| 19 | +``` |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +Create a migration file by running command |
| 24 | +`php artisan make:migration create_users_table` |
| 25 | +and then you can edit the migration file inside `database` folder. |
| 26 | + |
| 27 | +*NB:* see the [documentation by laravel](https://laravel.com/docs/6.x/migrations) |
13 | 28 |
|
14 | 29 | ## Available commands
|
15 | 30 | run `php artisan list` to show all available commands.
|
16 | 31 | - db
|
17 | 32 | * `php artisan db:seed` Seed the database with records
|
18 | 33 | * `php artisan db:wipe` Drop all tables, views, and types
|
19 |
| - |
| 34 | + |
20 | 35 | - make
|
21 | 36 | * `php artisan make:migration` Create a new migration file
|
22 | 37 | * `php artisan make:seeder` Create a new seeder class
|
23 |
| - |
| 38 | + |
24 | 39 | - migrate
|
25 | 40 | * `php artisan migrate:fresh` Drop all tables and re-run all migrations
|
26 | 41 | * `php artisan migrate:install` Create the migration repository
|
|
0 commit comments