Skip to content

Commit

Permalink
Disable foreign key before truncate table (luyadev#101)
Browse files Browse the repository at this point in the history
closes luyadev#20

commit summary: 
* Disable foreign key before truncate table luyadev#20
https://dev.mysql.com/doc/refman/5.7/en/truncate-table.html
https://tombevers.me/2013/10/14/how-to-truncate-a-foreign-key-constrained-table/
* Disable FOREIGN_KEY_CHECKS
* Insert 1000 rows after every 10 requests
* Changelog for luyadev#101 and luyadev#20
* Update ClientTransfer.php
* Update ClientTable.php
* Refactored data sync
* New option  for proxy command. luyadev#20
* Refactoring and add phpdocs
* Update ClientTable.php
  • Loading branch information
boehsermoe authored and nadar committed May 30, 2018
1 parent 3da6b47 commit de9f569
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 87 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. This projec

+ [#128](https://github.com/luyadev/luya-module-admin/issues/128) A new indicator display the amount of time left until the user is logged out automatically. Also every keystroke inside any text field will reset the logout timer to null. No more timeouts while working!
+ [#126](https://github.com/luyadev/luya-module-admin/issues/126) Provide option to eager load api model relations.
+ [#20](https://github.com/luyadev/luya-module-admin/issues/20) New option `--sync-requests-count` for proxy command.

### Fixed

Expand All @@ -16,6 +17,8 @@ All notable changes to this project will be documented in this file. This projec
+ [#129](https://github.com/luyadev/luya-module-admin/issues/129) Fixed problem when ngrest plugin try to write in object property instead of active record attribute.
+ [#125](https://github.com/luyadev/luya-module-admin/issues/125) Detach cruft behavior for global search response.
+ [#132](https://github.com/luyadev/luya-module-admin/pull/132) Fixed validation error on single file upload with the StorageUploadValidator.
+ [#101](https://github.com/luyadev/luya-module-admin/pull/101) Proxy command disable now FOREIGN_KEY_CHECKS, UNIQUE_CHECKS and SQL_MODE while data sync.
+ [#20](https://github.com/luyadev/luya-module-admin/issues/20) Proxy command need now less memory and a bit faster.

## 1.2.0 (17. May 2018)

Expand Down
9 changes: 7 additions & 2 deletions src/commands/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,18 @@ class ProxyController extends Command
* @var string The token which is used for the identifier, looks like this: ESOH1isB3ka_dF09ozkDJewpeecGCdUw
*/
public $token;

/**
* @var integer Number of requests collected until they are written to the database.
*/
public $syncRequestsCount = 10;

/**
* @inheritdoc
*/
public function options($actionID)
{
return array_merge(parent::options($actionID), ['strict', 'table', 'url', 'idf', 'token']);
return array_merge(parent::options($actionID), ['strict', 'table', 'url', 'idf', 'token', 'syncRequestsCount']);
}

/**
Expand Down Expand Up @@ -180,11 +185,11 @@ public function actionSync()
$this->flushHasCache();

$this->verbosePrint($curl->response);

$response = Json::decode($curl->response);
$build = new ClientBuild($this, [
'optionStrict' => $this->strict,
'optionTable' => $this->table,
'syncRequestsCount' => (int)$this->syncRequestsCount,
'buildToken' => sha1($response['buildToken']),
'buildConfig' => $response['config'],
'requestUrl' => $response['providerUrl'],
Expand Down
2 changes: 2 additions & 0 deletions src/proxy/ClientBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ClientBuild extends BaseObject
public $storageFilesCount;

public $optionStrict;

public $syncRequestsCount;

private $_optionTable;

Expand Down
Loading

0 comments on commit de9f569

Please sign in to comment.