Skip to content

Commit

Permalink
fix index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Aug 5, 2022
1 parent bb645d3 commit 0ee4d05
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"symfony/cache": "^6.1.3",
"symfony/http-client": "^6.1.3",
"symfony/uid": "^6.1.3",
"tarantool/mapper": "^5.0.8"
"tarantool/mapper": "^5.0.9"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions php/Job/Space/CreateIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ public function run(): void
];
$space->getMapper()->getClient()->call("box.space[$spaceId]:create_index", $this->name, [$options]);
} elseif (is_array($this->fields)) {
$properties = $space->getProperties();

$fields = $space->getFields();
foreach ($this->fields as $index) {
$fields[] = $properties[$index]->name;
}

$space->createIndex([
'name' => $this->name,
'fields' => $fields,
'fields' => $this->fields,
'unique' => $this->unique,
'type' => $this->type,
]);
Expand Down
4 changes: 4 additions & 0 deletions public/admin/js/Space/Indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ Ext.define('Admin.Space.Indexes', {
text: 'Create',
handler: () => {
var values = win.down('form').getValues();
var format = indexes.up('space-info').down('space-format').store;

values.fields = values.fields.map(i => format.getAt(i).get('name'));

var params = Ext.apply({
name: values.name,
fields: values.fields,
Expand Down

0 comments on commit 0ee4d05

Please sign in to comment.