Skip to content

Commit

Permalink
Add dynamic templates support. Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
babenkoivan committed Nov 13, 2020
1 parent 370d75c commit 2a1998a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
19 changes: 11 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,27 @@ php:
- 7.4

env:
- TESTBENCH_VERSION=4.0
- TESTBENCH_VERSION=5.0
- TESTBENCH_VERSION=^4.0
- TESTBENCH_VERSION=^5.0
- TESTBENCH_VERSION=^6.0

install:
- composer global require --no-interaction --prefer-dist --update-no-dev hirak/prestissimo
- composer require --no-interaction --prefer-dist orchestra/testbench:$TESTBENCH_VERSION
- composer require --no-interaction orchestra/testbench:$TESTBENCH_VERSION

script: make test

jobs:
exclude:
- php: 7.2
env: TESTBENCH_VERSION=^6.0
include:
- stage: code-analysis
name: Code Style Check
php: 7.2
env: TESTBENCH_VERSION=^5.0
php: 7.4
env: TESTBENCH_VERSION=^6.0
script: make style-check
- stage: code-analysis
name: Static Code Analysis
php: 7.2
env: TESTBENCH_VERSION=^5.0
php: 7.4
env: TESTBENCH_VERSION=^6.0
script: make static-analysis
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The current version of Elastic Migrations has been tested with the following con

* PHP 7.2-7.4
* Elasticsearch 7.x
* Laravel 6.x-7.x
* Laravel 6.x-8.x

## Installation

Expand Down Expand Up @@ -98,8 +98,16 @@ Index::create('my-index', function (Mapping $mapping, Settings $settings) {
// first argument as a field name and optional second argument as additional field parameters
$mapping->text('title', ['boost' => 2]);
$mapping->float('price');

// you can define a dynamic template as follows
$mapping->dynamicTemplate('my_template_name', [
'match_mapping_type' => 'long',
'mapping' => [
'type' => 'integer',
],
]);

// you can change the index settings
// you can also change the index settings
$settings->index([
'number_of_replicas' => 2,
'refresh_interval' => -1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"require": {
"php": "^7.2",
"babenkoivan/elastic-client": "^1.0",
"babenkoivan/elastic-adapter": "^1.0"
"babenkoivan/elastic-adapter": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^8.4",
Expand Down
4 changes: 2 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ parameters:
path: src/Console/MakeCommand.php

-
message: "#^Parameter \\#1 \\$fileName of method ElasticMigrations\\\\Migrator\\:\\:migrateOne\\(\\) expects string, \\(array\\)\\|string given\\.$#"
message: "#^Parameter \\#1 \\$fileName of method ElasticMigrations\\\\Migrator\\:\\:migrateOne\\(\\) expects string, array\\|string given\\.$#"
count: 1
path: src/Console/MigrateCommand.php

-
message: "#^Parameter \\#1 \\$fileName of method ElasticMigrations\\\\Migrator\\:\\:rollbackOne\\(\\) expects string, \\(array\\)\\|string given\\.$#"
message: "#^Parameter \\#1 \\$fileName of method ElasticMigrations\\\\Migrator\\:\\:rollbackOne\\(\\) expects string, array\\|string given\\.$#"
count: 1
path: src/Console/RollbackCommand.php

0 comments on commit 2a1998a

Please sign in to comment.