Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete file migrations. #8

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,6 @@ Elasticsearch migration for laravel.
The package is registered through the package discovery of laravel and Composer.
>https://laravel.com/docs/5.6/packages

## Configuration
| Key | ENV | Value | Description |
|:-------------:|-------------:|:-------------:|:-----:|
| host | ELASTICSEARCH_HOST | STRING | Host |
| port | ELASTICSEARCH_PORT | INTEGER | Default: 9200 |
| scheme | ELASTICSEARCH_SCHEME | STRING | https or http |
| user | ELASTICSEARCH_USER | STRING | Username |
| pass | ELASTICSEARCH_PASS | STRING | Password |
| migration.filePath | --- | STRING | File path for migration scripts |

## Usage

### Build migration
>Triadev\EsMigration\Business\Factory\MigrationBuilder::TYPE()

- createIndex
- updateIndex
- deleteIndex
- alias
- reindex
- deleteByQuery
- updateByQuery

### Commands

#### Start migration
Orchestra migrations
>php artisan triadev:elasticsearch:migrate:start VERSIONS

Example:
>php artisan triadev:elasticsearch:migrate:start migration1,migration2,migration3

#### Show migrations
>php artisan triadev:elasticsearch:migration:show

### Events
[Documentation: Laravel Events](https://laravel.com/docs/5.7/events)

Expand Down
13 changes: 0 additions & 13 deletions examples/addAndRemoveAlias/migrations.php

This file was deleted.

36 changes: 0 additions & 36 deletions examples/createAndUpdateIndex/migrations.php

This file was deleted.

19 changes: 0 additions & 19 deletions examples/createIndex/migrations.php

This file was deleted.

16 changes: 0 additions & 16 deletions examples/deleteByQuery/migrations.php

This file was deleted.

5 changes: 0 additions & 5 deletions examples/deleteIndex/migrations.php

This file was deleted.

9 changes: 0 additions & 9 deletions examples/reindex/migrations.php

This file was deleted.

20 changes: 0 additions & 20 deletions examples/updateByQuery/migrations.php

This file was deleted.

21 changes: 0 additions & 21 deletions examples/updateIndex/migrations.php

This file was deleted.

1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="ELASTICSEARCH_PORT" value="9222"/>
</php>
</phpunit>
152 changes: 0 additions & 152 deletions src/Business/Factory/MigrationBuilder.php

This file was deleted.

32 changes: 32 additions & 0 deletions src/Business/Mapper/MigrationStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
namespace Triadev\EsMigration\Business\Mapper;

class MigrationStatus
{
const MIGRATION_STATUS_WAIT = 0;
const MIGRATION_STATUS_RUNNING = 1;
const MIGRATION_STATUS_DONE = 2;
const MIGRATION_STATUS_ERROR = 3;

/**
* Is migration status valid
*
* @param int $status
* @return bool
*/
public function isMigrationStatusValid(int $status) : bool
{
$valid = [
self::MIGRATION_STATUS_WAIT,
self::MIGRATION_STATUS_RUNNING,
self::MIGRATION_STATUS_DONE,
self::MIGRATION_STATUS_ERROR
];

if (in_array($status, $valid)) {
return true;
}

return false;
}
}
Loading