Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
nasrulhazim committed Jul 18, 2023
1 parent e27a8fb commit 92ab103
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ You can publish the config file with:
php artisan vendor:publish --tag="data-migration-config"
```

## Usage

Configure the connections to the database that you need to migrate from (the source) and it's destination in the `config/data-migration.php` in `connections` key.

Once that completed, update the `tables` configuration in `config/data-migration.php`. This is the mapping of the data migration from source table to destination table.
Expand All @@ -33,9 +31,31 @@ Once that completed, update the `tables` configuration in `config/data-migration
'tables' => [
'_source_table' => 'destination_table',
'media' => 'app_media',
]...
]
```

You can set to run the Laravel migration by following setting. By default this option is disabled.

```text
DATA_MIGRATION_RUN=true
``
You may want to enable Foreign Key check as well. By default this option is disabled.
```text
DATA_MIGRATION_FK_CHECK=false
```

You also can truncate the destination table before migrating the data. By default this option is enabled.

```text
DATA_MIGRATE_TRUNCATE=true
```

## Usage

> Before you run this command, please make sure you are firmed with the configuration and run the data migration in non-production environment.
To start migrate, run the following command:

```bash
Expand Down

0 comments on commit 92ab103

Please sign in to comment.