removed all traces of migrations from community server.

Exception is the composer.lock, this is corrected with the next install
This commit is contained in:
Ulf Gebhardt 2021-08-25 11:24:31 +02:00
parent b721428abc
commit 53dbc95f7e
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
20 changed files with 2 additions and 797 deletions

View File

@ -7,7 +7,6 @@
"require": { "require": {
"php": ">=5.6", "php": ">=5.6",
"cakephp/cakephp": "3.9.*", "cakephp/cakephp": "3.9.*",
"cakephp/migrations": "^2.0.0",
"cakephp/plugin-installer": "^1.0", "cakephp/plugin-installer": "^1.0",
"datto/json-rpc": "^6.0", "datto/json-rpc": "^6.0",
"google/protobuf": "v3.10.*", "google/protobuf": "v3.10.*",

View File

@ -112,8 +112,6 @@ class Application extends BaseApplication
// Do not halt if the plugin is missing // Do not halt if the plugin is missing
} }
$this->addPlugin('Migrations');
// Load more plugins here // Load more plugins here
} }
} }

View File

@ -143,24 +143,8 @@ class AppController extends Controller
} }
} }
protected function checkForMigration($html = true)
{
$migrationsTable = TableRegistry::getTableLocator()->get('Migrations');
$last_migration = $migrationsTable->find()->last();
$current_db_version = 1;
if($last_migration) {
$current_db_version = $last_migration->db_version;
}
$php_data_version = 3;
if($current_db_version < $php_data_version) {
$this->redirect(['controller' => 'Migrations', 'action' => 'migrate', 'html' => $html, 'db_version' => $current_db_version]);
}
}
protected function requestLogin($sessionId = 0, $redirect = true) protected function requestLogin($sessionId = 0, $redirect = true)
{ {
$this->checkForMigration($redirect);
$stateBalancesTable = TableRegistry::getTableLocator()->get('StateBalances'); $stateBalancesTable = TableRegistry::getTableLocator()->get('StateBalances');
$session = $this->getRequest()->getSession(); $session = $this->getRequest()->getSession();
// check login // check login

View File

@ -1,176 +0,0 @@
<?php
namespace App\Controller;
use App\Controller\AppController;
use Cake\ORM\TableRegistry;
/**
* Migrations Controller
*
* @property \App\Model\Table\MigrationsTable $Migrations
*
* @method \App\Model\Entity\Migration[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class MigrationsController extends AppController
{
public function initialize()
{
parent::initialize();
$this->Auth->allow('migrate');
}
/**
* Index method
*
* @return \Cake\Http\Response|null
*/
public function index()
{
$migrations = $this->paginate($this->Migrations);
$this->set(compact('migrations'));
}
protected function callFunctions(array $callables)
{
foreach($callables as $callable) {
$result = call_user_func($callable);
if(!$result['success']) {
return $result;
}
}
return ['success' => true];
}
public function migrate()
{
$html = $this->request->getQuery('html');
$current_db_version = $this->request->getQuery('db_version');
$startTime = microtime(true);
$stateUserTransactionsTable = TableRegistry::getTableLocator()->get('StateUserTransactions');
$transactionsTable = TableRegistry::getTableLocator()->get('Transactions');
$transactionTypesTable = TableRegistry::getTableLocator()->get('TransactionTypes');
$stateBalancesTable = TableRegistry::getTableLocator()->get('StateBalances');
$blockchainTypesTable = TableRegistry::getTableLocator()->get('BlockchainTypes');
$new_db_version = 1;
$commands = [];
// migrate from version 1 to 2
if($current_db_version == 1) {
$stateUserTransactionsTable->truncate();
$commands = [
[$blockchainTypesTable, 'fillWithDefault'],
[$transactionTypesTable, 'fillWithDefault'],
[$stateBalancesTable, 'truncate'],
[$transactionsTable, 'fillStateUserTransactions'],
[$stateBalancesTable, 'updateAllBalances']
];
$new_db_version = 2;
} else if($current_db_version == 2) {
$commands = [
[$stateUserTransactionsTable, 'truncate'],
[$stateBalancesTable, 'truncate'],
[$transactionsTable, 'fillStateUserTransactions'],
[$stateBalancesTable, 'updateAllBalances']
];
$new_db_version = 3;
}
$migration_result = $this->callFunctions($commands);
if($migration_result['success']) {
$migration_entity = $this->Migrations->newEntity();
$migration_entity->db_version = $new_db_version;
$this->Migrations->save($migration_entity);
}
if(!$html) {
return $this->returnJson($migration_result);
} else {
$this->set('db_version', $current_db_version);
$this->set('result', $migration_result);
$this->set('timeUsed', microtime(true) - $startTime);
}
}
/**
* View method
*
* @param string|null $id Migration id.
* @return \Cake\Http\Response|null
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function view($id = null)
{
$migration = $this->Migrations->get($id, [
'contain' => [],
]);
$this->set('migration', $migration);
}
/**
* Add method
*
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
*/
public function add()
{
$migration = $this->Migrations->newEntity();
if ($this->request->is('post')) {
$migration = $this->Migrations->patchEntity($migration, $this->request->getData());
if ($this->Migrations->save($migration)) {
$this->Flash->success(__('The migration has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The migration could not be saved. Please, try again.'));
}
$this->set(compact('migration'));
}
/**
* Edit method
*
* @param string|null $id Migration id.
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function edit($id = null)
{
$migration = $this->Migrations->get($id, [
'contain' => [],
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$migration = $this->Migrations->patchEntity($migration, $this->request->getData());
if ($this->Migrations->save($migration)) {
$this->Flash->success(__('The migration has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The migration could not be saved. Please, try again.'));
}
$this->set(compact('migration'));
}
/**
* Delete method
*
* @param string|null $id Migration id.
* @return \Cake\Http\Response|null Redirects to index.
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
*/
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$migration = $this->Migrations->get($id);
if ($this->Migrations->delete($migration)) {
$this->Flash->success(__('The migration has been deleted.'));
} else {
$this->Flash->error(__('The migration could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
}

View File

@ -157,24 +157,6 @@ msgstr ""
msgid "Gradido Transaktion fehlgeschlagen!" msgid "Gradido Transaktion fehlgeschlagen!"
msgstr "" msgstr ""
#: Controller/MigrationsController.php:124
#: Controller/MigrationsController.php:148
msgid "The migration has been saved."
msgstr ""
#: Controller/MigrationsController.php:128
#: Controller/MigrationsController.php:152
msgid "The migration could not be saved. Please, try again."
msgstr ""
#: Controller/MigrationsController.php:169
msgid "The migration has been deleted."
msgstr ""
#: Controller/MigrationsController.php:171
msgid "The migration could not be deleted. Please, try again."
msgstr ""
#: Controller/OperatorTypesController.php:54 #: Controller/OperatorTypesController.php:54
#: Controller/OperatorTypesController.php:78 #: Controller/OperatorTypesController.php:78
msgid "The operator type has been saved." msgid "The operator type has been saved."
@ -858,9 +840,6 @@ msgstr ""
#: Template/CommunityProfiles/view.ctp:9 Template/ElopageBuys/add.ctp:9 #: Template/CommunityProfiles/view.ctp:9 Template/ElopageBuys/add.ctp:9
#: Template/ElopageBuys/edit.ctp:9 Template/ElopageBuys/index.ctp:9 #: Template/ElopageBuys/edit.ctp:9 Template/ElopageBuys/index.ctp:9
#: Template/ElopageBuys/index.ctp:30 Template/ElopageBuys/view.ctp:9 #: Template/ElopageBuys/index.ctp:30 Template/ElopageBuys/view.ctp:9
#: Template/Migrations/add.ctp:9 Template/Migrations/edit.ctp:9
#: Template/Migrations/index.ctp:9 Template/Migrations/index.ctp:20
#: Template/Migrations/view.ctp:9 Template/OperatorTypes/add.ctp:9
#: Template/OperatorTypes/edit.ctp:9 Template/OperatorTypes/index.ctp:9 #: Template/OperatorTypes/edit.ctp:9 Template/OperatorTypes/index.ctp:9
#: Template/OperatorTypes/index.ctp:23 Template/OperatorTypes/view.ctp:9 #: Template/OperatorTypes/index.ctp:23 Template/OperatorTypes/view.ctp:9
#: Template/OperatorTypes/view.ctp:43 Template/Operators/add.ctp:9 #: Template/OperatorTypes/view.ctp:43 Template/Operators/add.ctp:9
@ -1011,7 +990,6 @@ msgstr ""
#: Template/BlockchainTypes/add.ctp:23 Template/BlockchainTypes/edit.ctp:29 #: Template/BlockchainTypes/add.ctp:23 Template/BlockchainTypes/edit.ctp:29
#: Template/CommunityProfiles/add.ctp:22 Template/CommunityProfiles/edit.ctp:28 #: Template/CommunityProfiles/add.ctp:22 Template/CommunityProfiles/edit.ctp:28
#: Template/ElopageBuys/add.ctp:31 Template/ElopageBuys/edit.ctp:37 #: Template/ElopageBuys/add.ctp:31 Template/ElopageBuys/edit.ctp:37
#: Template/Migrations/add.ctp:21 Template/Migrations/edit.ctp:27
#: Template/OperatorTypes/add.ctp:24 Template/OperatorTypes/edit.ctp:30 #: Template/OperatorTypes/add.ctp:24 Template/OperatorTypes/edit.ctp:30
#: Template/Operators/add.ctp:24 Template/Operators/edit.ctp:30 #: Template/Operators/add.ctp:24 Template/Operators/edit.ctp:30
#: Template/Roles/add.ctp:21 Template/Roles/edit.ctp:27 #: Template/Roles/add.ctp:21 Template/Roles/edit.ctp:27
@ -1051,8 +1029,6 @@ msgstr ""
#: Template/BlockchainTypes/edit.ctp:11 Template/BlockchainTypes/index.ctp:35 #: Template/BlockchainTypes/edit.ctp:11 Template/BlockchainTypes/index.ctp:35
#: Template/CommunityProfiles/edit.ctp:11 #: Template/CommunityProfiles/edit.ctp:11
#: Template/CommunityProfiles/index.ctp:33 Template/ElopageBuys/edit.ctp:11 #: Template/CommunityProfiles/index.ctp:33 Template/ElopageBuys/edit.ctp:11
#: Template/ElopageBuys/index.ctp:51 Template/Migrations/edit.ctp:11
#: Template/Migrations/index.ctp:31 Template/OperatorTypes/edit.ctp:11
#: Template/OperatorTypes/index.ctp:35 Template/OperatorTypes/view.ctp:54 #: Template/OperatorTypes/index.ctp:35 Template/OperatorTypes/view.ctp:54
#: Template/Operators/edit.ctp:11 Template/Operators/index.ctp:40 #: Template/Operators/edit.ctp:11 Template/Operators/index.ctp:40
#: Template/Roles/edit.ctp:11 Template/Roles/index.ctp:31 #: Template/Roles/edit.ctp:11 Template/Roles/index.ctp:31
@ -1102,8 +1078,6 @@ msgstr ""
#: Template/CommunityProfiles/index.ctp:33 #: Template/CommunityProfiles/index.ctp:33
#: Template/CommunityProfiles/view.ctp:11 Template/ElopageBuys/edit.ctp:13 #: Template/CommunityProfiles/view.ctp:11 Template/ElopageBuys/edit.ctp:13
#: Template/ElopageBuys/index.ctp:51 Template/ElopageBuys/view.ctp:11 #: Template/ElopageBuys/index.ctp:51 Template/ElopageBuys/view.ctp:11
#: Template/Migrations/edit.ctp:13 Template/Migrations/index.ctp:31
#: Template/Migrations/view.ctp:11 Template/OperatorTypes/edit.ctp:13
#: Template/OperatorTypes/index.ctp:35 Template/OperatorTypes/view.ctp:11 #: Template/OperatorTypes/index.ctp:35 Template/OperatorTypes/view.ctp:11
#: Template/OperatorTypes/view.ctp:54 Template/Operators/edit.ctp:13 #: Template/OperatorTypes/view.ctp:54 Template/Operators/edit.ctp:13
#: Template/Operators/index.ctp:40 Template/Operators/view.ctp:11 #: Template/Operators/index.ctp:40 Template/Operators/view.ctp:11
@ -1183,7 +1157,6 @@ msgstr ""
#: Template/AddressTypes/view.ctp:83 Template/AdminErrors/index.ctp:39 #: Template/AddressTypes/view.ctp:83 Template/AdminErrors/index.ctp:39
#: Template/BlockchainTypes/index.ctp:33 #: Template/BlockchainTypes/index.ctp:33
#: Template/CommunityProfiles/index.ctp:31 Template/ElopageBuys/index.ctp:49 #: Template/CommunityProfiles/index.ctp:31 Template/ElopageBuys/index.ctp:49
#: Template/Migrations/index.ctp:29 Template/OperatorTypes/index.ctp:33
#: Template/OperatorTypes/view.ctp:52 Template/Operators/index.ctp:38 #: Template/OperatorTypes/view.ctp:52 Template/Operators/index.ctp:38
#: Template/Roles/index.ctp:29 Template/ServerUsers/index.ctp:41 #: Template/Roles/index.ctp:29 Template/ServerUsers/index.ctp:41
#: Template/StateBalances/index.ctp:36 Template/StateCreated/index.ctp:43 #: Template/StateBalances/index.ctp:36 Template/StateCreated/index.ctp:43
@ -1215,7 +1188,6 @@ msgstr ""
#: Template/AddressTypes/view.ctp:84 Template/AdminErrors/index.ctp:41 #: Template/AddressTypes/view.ctp:84 Template/AdminErrors/index.ctp:41
#: Template/BlockchainTypes/index.ctp:34 #: Template/BlockchainTypes/index.ctp:34
#: Template/CommunityProfiles/index.ctp:32 Template/ElopageBuys/index.ctp:50 #: Template/CommunityProfiles/index.ctp:32 Template/ElopageBuys/index.ctp:50
#: Template/Migrations/index.ctp:30 Template/OperatorTypes/index.ctp:34
#: Template/OperatorTypes/view.ctp:53 Template/Operators/index.ctp:39 #: Template/OperatorTypes/view.ctp:53 Template/Operators/index.ctp:39
#: Template/Roles/index.ctp:30 Template/ServerUsers/index.ctp:42 #: Template/Roles/index.ctp:30 Template/ServerUsers/index.ctp:42
#: Template/StateBalances/index.ctp:37 Template/StateCreated/index.ctp:44 #: Template/StateBalances/index.ctp:37 Template/StateCreated/index.ctp:44
@ -1242,7 +1214,6 @@ msgstr ""
#: Template/AddressTypes/index.ctp:45 Template/AdminErrors/index.ctp:50 #: Template/AddressTypes/index.ctp:45 Template/AdminErrors/index.ctp:50
#: Template/BlockchainTypes/index.ctp:43 #: Template/BlockchainTypes/index.ctp:43
#: Template/CommunityProfiles/index.ctp:41 Template/ElopageBuys/index.ctp:59 #: Template/CommunityProfiles/index.ctp:41 Template/ElopageBuys/index.ctp:59
#: Template/Migrations/index.ctp:39 Template/OperatorTypes/index.ctp:43
#: Template/Operators/index.ctp:48 Template/Roles/index.ctp:39 #: Template/Operators/index.ctp:48 Template/Roles/index.ctp:39
#: Template/ServerUsers/index.ctp:51 Template/StateBalances/index.ctp:46 #: Template/ServerUsers/index.ctp:51 Template/StateBalances/index.ctp:46
#: Template/StateCreated/index.ctp:53 Template/StateErrors/index.ctp:47 #: Template/StateCreated/index.ctp:53 Template/StateErrors/index.ctp:47
@ -1266,7 +1237,6 @@ msgstr ""
#: Template/AddressTypes/index.ctp:46 Template/AdminErrors/index.ctp:51 #: Template/AddressTypes/index.ctp:46 Template/AdminErrors/index.ctp:51
#: Template/BlockchainTypes/index.ctp:44 #: Template/BlockchainTypes/index.ctp:44
#: Template/CommunityProfiles/index.ctp:42 Template/ElopageBuys/index.ctp:60 #: Template/CommunityProfiles/index.ctp:42 Template/ElopageBuys/index.ctp:60
#: Template/Migrations/index.ctp:40 Template/OperatorTypes/index.ctp:44
#: Template/Operators/index.ctp:49 Template/Roles/index.ctp:40 #: Template/Operators/index.ctp:49 Template/Roles/index.ctp:40
#: Template/ServerUsers/index.ctp:52 Template/StateBalances/index.ctp:47 #: Template/ServerUsers/index.ctp:52 Template/StateBalances/index.ctp:47
#: Template/StateCreated/index.ctp:54 Template/StateErrors/index.ctp:48 #: Template/StateCreated/index.ctp:54 Template/StateErrors/index.ctp:48
@ -1290,7 +1260,6 @@ msgstr ""
#: Template/AddressTypes/index.ctp:48 Template/AdminErrors/index.ctp:53 #: Template/AddressTypes/index.ctp:48 Template/AdminErrors/index.ctp:53
#: Template/BlockchainTypes/index.ctp:46 #: Template/BlockchainTypes/index.ctp:46
#: Template/CommunityProfiles/index.ctp:44 Template/ElopageBuys/index.ctp:62 #: Template/CommunityProfiles/index.ctp:44 Template/ElopageBuys/index.ctp:62
#: Template/Migrations/index.ctp:42 Template/OperatorTypes/index.ctp:46
#: Template/Operators/index.ctp:51 Template/Roles/index.ctp:42 #: Template/Operators/index.ctp:51 Template/Roles/index.ctp:42
#: Template/ServerUsers/index.ctp:54 Template/StateBalances/index.ctp:49 #: Template/ServerUsers/index.ctp:54 Template/StateBalances/index.ctp:49
#: Template/StateCreated/index.ctp:56 Template/StateErrors/index.ctp:50 #: Template/StateCreated/index.ctp:56 Template/StateErrors/index.ctp:50
@ -1314,7 +1283,6 @@ msgstr ""
#: Template/AddressTypes/index.ctp:49 Template/AdminErrors/index.ctp:54 #: Template/AddressTypes/index.ctp:49 Template/AdminErrors/index.ctp:54
#: Template/BlockchainTypes/index.ctp:47 #: Template/BlockchainTypes/index.ctp:47
#: Template/CommunityProfiles/index.ctp:45 Template/ElopageBuys/index.ctp:63 #: Template/CommunityProfiles/index.ctp:45 Template/ElopageBuys/index.ctp:63
#: Template/Migrations/index.ctp:43 Template/OperatorTypes/index.ctp:47
#: Template/Operators/index.ctp:52 Template/Roles/index.ctp:43 #: Template/Operators/index.ctp:52 Template/Roles/index.ctp:43
#: Template/ServerUsers/index.ctp:55 Template/StateBalances/index.ctp:50 #: Template/ServerUsers/index.ctp:55 Template/StateBalances/index.ctp:50
#: Template/StateCreated/index.ctp:57 Template/StateErrors/index.ctp:51 #: Template/StateCreated/index.ctp:57 Template/StateErrors/index.ctp:51
@ -1338,7 +1306,6 @@ msgstr ""
#: Template/AddressTypes/index.ctp:51 Template/AdminErrors/index.ctp:56 #: Template/AddressTypes/index.ctp:51 Template/AdminErrors/index.ctp:56
#: Template/BlockchainTypes/index.ctp:49 #: Template/BlockchainTypes/index.ctp:49
#: Template/CommunityProfiles/index.ctp:47 Template/ElopageBuys/index.ctp:65 #: Template/CommunityProfiles/index.ctp:47 Template/ElopageBuys/index.ctp:65
#: Template/Migrations/index.ctp:45 Template/OperatorTypes/index.ctp:49
#: Template/Operators/index.ctp:54 Template/Roles/index.ctp:45 #: Template/Operators/index.ctp:54 Template/Roles/index.ctp:45
#: Template/ServerUsers/index.ctp:57 Template/StateBalances/index.ctp:52 #: Template/ServerUsers/index.ctp:57 Template/StateBalances/index.ctp:52
#: Template/StateCreated/index.ctp:59 Template/StateErrors/index.ctp:53 #: Template/StateCreated/index.ctp:59 Template/StateErrors/index.ctp:53
@ -1385,7 +1352,6 @@ msgstr ""
#: Template/AddressTypes/view.ctp:32 Template/AddressTypes/view.ctp:41 #: Template/AddressTypes/view.ctp:32 Template/AddressTypes/view.ctp:41
#: Template/AddressTypes/view.ctp:68 Template/AdminErrors/view.ctp:46 #: Template/AddressTypes/view.ctp:68 Template/AdminErrors/view.ctp:46
#: Template/BlockchainTypes/view.ctp:32 Template/CommunityProfiles/view.ctp:24 #: Template/BlockchainTypes/view.ctp:32 Template/CommunityProfiles/view.ctp:24
#: Template/ElopageBuys/view.ctp:32 Template/Migrations/view.ctp:20
#: Template/OperatorTypes/view.ctp:30 Template/OperatorTypes/view.ctp:39 #: Template/OperatorTypes/view.ctp:30 Template/OperatorTypes/view.ctp:39
#: Template/Operators/view.ctp:32 Template/Roles/view.ctp:24 #: Template/Operators/view.ctp:32 Template/Roles/view.ctp:24
#: Template/ServerUsers/view.ctp:36 Template/StateBalances/view.ctp:27 #: Template/ServerUsers/view.ctp:36 Template/StateBalances/view.ctp:27
@ -1875,35 +1841,6 @@ msgstr ""
msgid "Community Server in Entwicklung" msgid "Community Server in Entwicklung"
msgstr "" msgstr ""
#: Template/Migrations/add.ctp:10 Template/Migrations/edit.ctp:16
#: Template/Migrations/view.ctp:12
msgid "List Migrations"
msgstr ""
#: Template/Migrations/add.ctp:16
msgid "Add Migration"
msgstr ""
#: Template/Migrations/edit.ctp:22 Template/Migrations/view.ctp:10
msgid "Edit Migration"
msgstr ""
#: Template/Migrations/index.ctp:10 Template/Migrations/view.ctp:13
msgid "New Migration"
msgstr ""
#: Template/Migrations/index.ctp:14
msgid "Migrations"
msgstr ""
#: Template/Migrations/view.ctp:11
msgid "Delete Migration"
msgstr ""
#: Template/Migrations/view.ctp:24
msgid "Db Version"
msgstr ""
#: Template/OperatorTypes/add.ctp:10 Template/OperatorTypes/edit.ctp:16 #: Template/OperatorTypes/add.ctp:10 Template/OperatorTypes/edit.ctp:16
#: Template/OperatorTypes/view.ctp:12 #: Template/OperatorTypes/view.ctp:12
msgid "List Operator Types" msgid "List Operator Types"

View File

@ -159,24 +159,6 @@ msgstr ""
msgid "Gradido Transaktion fehlgeschlagen!" msgid "Gradido Transaktion fehlgeschlagen!"
msgstr "" msgstr ""
#: Controller/MigrationsController.php:124
#: Controller/MigrationsController.php:148
msgid "The migration has been saved."
msgstr ""
#: Controller/MigrationsController.php:128
#: Controller/MigrationsController.php:152
msgid "The migration could not be saved. Please, try again."
msgstr ""
#: Controller/MigrationsController.php:169
msgid "The migration has been deleted."
msgstr ""
#: Controller/MigrationsController.php:171
msgid "The migration could not be deleted. Please, try again."
msgstr ""
#: Controller/OperatorTypesController.php:54 #: Controller/OperatorTypesController.php:54
#: Controller/OperatorTypesController.php:78 #: Controller/OperatorTypesController.php:78
msgid "The operator type has been saved." msgid "The operator type has been saved."
@ -883,11 +865,6 @@ msgstr ""
#: Template/ElopageBuys/index.ctp:9 #: Template/ElopageBuys/index.ctp:9
#: Template/ElopageBuys/index.ctp:30 #: Template/ElopageBuys/index.ctp:30
#: Template/ElopageBuys/view.ctp:9 #: Template/ElopageBuys/view.ctp:9
#: Template/Migrations/add.ctp:9
#: Template/Migrations/edit.ctp:9
#: Template/Migrations/index.ctp:9
#: Template/Migrations/index.ctp:20
#: Template/Migrations/view.ctp:9
#: Template/OperatorTypes/add.ctp:9 #: Template/OperatorTypes/add.ctp:9
#: Template/OperatorTypes/edit.ctp:9 #: Template/OperatorTypes/edit.ctp:9
#: Template/OperatorTypes/index.ctp:9 #: Template/OperatorTypes/index.ctp:9
@ -1102,8 +1079,6 @@ msgstr ""
#: Template/CommunityProfiles/edit.ctp:28 #: Template/CommunityProfiles/edit.ctp:28
#: Template/ElopageBuys/add.ctp:31 #: Template/ElopageBuys/add.ctp:31
#: Template/ElopageBuys/edit.ctp:37 #: Template/ElopageBuys/edit.ctp:37
#: Template/Migrations/add.ctp:21
#: Template/Migrations/edit.ctp:27
#: Template/OperatorTypes/add.ctp:24 #: Template/OperatorTypes/add.ctp:24
#: Template/OperatorTypes/edit.ctp:30 #: Template/OperatorTypes/edit.ctp:30
#: Template/Operators/add.ctp:24 #: Template/Operators/add.ctp:24
@ -1163,8 +1138,6 @@ msgstr ""
#: Template/CommunityProfiles/index.ctp:33 #: Template/CommunityProfiles/index.ctp:33
#: Template/ElopageBuys/edit.ctp:11 #: Template/ElopageBuys/edit.ctp:11
#: Template/ElopageBuys/index.ctp:51 #: Template/ElopageBuys/index.ctp:51
#: Template/Migrations/edit.ctp:11
#: Template/Migrations/index.ctp:31
#: Template/OperatorTypes/edit.ctp:11 #: Template/OperatorTypes/edit.ctp:11
#: Template/OperatorTypes/index.ctp:35 #: Template/OperatorTypes/index.ctp:35
#: Template/OperatorTypes/view.ctp:54 #: Template/OperatorTypes/view.ctp:54
@ -1241,9 +1214,6 @@ msgstr ""
#: Template/ElopageBuys/edit.ctp:13 #: Template/ElopageBuys/edit.ctp:13
#: Template/ElopageBuys/index.ctp:51 #: Template/ElopageBuys/index.ctp:51
#: Template/ElopageBuys/view.ctp:11 #: Template/ElopageBuys/view.ctp:11
#: Template/Migrations/edit.ctp:13
#: Template/Migrations/index.ctp:31
#: Template/Migrations/view.ctp:11
#: Template/OperatorTypes/edit.ctp:13 #: Template/OperatorTypes/edit.ctp:13
#: Template/OperatorTypes/index.ctp:35 #: Template/OperatorTypes/index.ctp:35
#: Template/OperatorTypes/view.ctp:11 #: Template/OperatorTypes/view.ctp:11
@ -1353,7 +1323,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:33 #: Template/BlockchainTypes/index.ctp:33
#: Template/CommunityProfiles/index.ctp:31 #: Template/CommunityProfiles/index.ctp:31
#: Template/ElopageBuys/index.ctp:49 #: Template/ElopageBuys/index.ctp:49
#: Template/Migrations/index.ctp:29
#: Template/OperatorTypes/index.ctp:33 #: Template/OperatorTypes/index.ctp:33
#: Template/OperatorTypes/view.ctp:52 #: Template/OperatorTypes/view.ctp:52
#: Template/Operators/index.ctp:38 #: Template/Operators/index.ctp:38
@ -1403,7 +1372,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:34 #: Template/BlockchainTypes/index.ctp:34
#: Template/CommunityProfiles/index.ctp:32 #: Template/CommunityProfiles/index.ctp:32
#: Template/ElopageBuys/index.ctp:50 #: Template/ElopageBuys/index.ctp:50
#: Template/Migrations/index.ctp:30
#: Template/OperatorTypes/index.ctp:34 #: Template/OperatorTypes/index.ctp:34
#: Template/OperatorTypes/view.ctp:53 #: Template/OperatorTypes/view.ctp:53
#: Template/Operators/index.ctp:39 #: Template/Operators/index.ctp:39
@ -1445,7 +1413,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:43 #: Template/BlockchainTypes/index.ctp:43
#: Template/CommunityProfiles/index.ctp:41 #: Template/CommunityProfiles/index.ctp:41
#: Template/ElopageBuys/index.ctp:59 #: Template/ElopageBuys/index.ctp:59
#: Template/Migrations/index.ctp:39
#: Template/OperatorTypes/index.ctp:43 #: Template/OperatorTypes/index.ctp:43
#: Template/Operators/index.ctp:48 #: Template/Operators/index.ctp:48
#: Template/Roles/index.ctp:39 #: Template/Roles/index.ctp:39
@ -1477,7 +1444,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:44 #: Template/BlockchainTypes/index.ctp:44
#: Template/CommunityProfiles/index.ctp:42 #: Template/CommunityProfiles/index.ctp:42
#: Template/ElopageBuys/index.ctp:60 #: Template/ElopageBuys/index.ctp:60
#: Template/Migrations/index.ctp:40
#: Template/OperatorTypes/index.ctp:44 #: Template/OperatorTypes/index.ctp:44
#: Template/Operators/index.ctp:49 #: Template/Operators/index.ctp:49
#: Template/Roles/index.ctp:40 #: Template/Roles/index.ctp:40
@ -1509,7 +1475,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:46 #: Template/BlockchainTypes/index.ctp:46
#: Template/CommunityProfiles/index.ctp:44 #: Template/CommunityProfiles/index.ctp:44
#: Template/ElopageBuys/index.ctp:62 #: Template/ElopageBuys/index.ctp:62
#: Template/Migrations/index.ctp:42
#: Template/OperatorTypes/index.ctp:46 #: Template/OperatorTypes/index.ctp:46
#: Template/Operators/index.ctp:51 #: Template/Operators/index.ctp:51
#: Template/Roles/index.ctp:42 #: Template/Roles/index.ctp:42
@ -1541,7 +1506,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:47 #: Template/BlockchainTypes/index.ctp:47
#: Template/CommunityProfiles/index.ctp:45 #: Template/CommunityProfiles/index.ctp:45
#: Template/ElopageBuys/index.ctp:63 #: Template/ElopageBuys/index.ctp:63
#: Template/Migrations/index.ctp:43
#: Template/OperatorTypes/index.ctp:47 #: Template/OperatorTypes/index.ctp:47
#: Template/Operators/index.ctp:52 #: Template/Operators/index.ctp:52
#: Template/Roles/index.ctp:43 #: Template/Roles/index.ctp:43
@ -1573,7 +1537,6 @@ msgstr ""
#: Template/BlockchainTypes/index.ctp:49 #: Template/BlockchainTypes/index.ctp:49
#: Template/CommunityProfiles/index.ctp:47 #: Template/CommunityProfiles/index.ctp:47
#: Template/ElopageBuys/index.ctp:65 #: Template/ElopageBuys/index.ctp:65
#: Template/Migrations/index.ctp:45
#: Template/OperatorTypes/index.ctp:49 #: Template/OperatorTypes/index.ctp:49
#: Template/Operators/index.ctp:54 #: Template/Operators/index.ctp:54
#: Template/Roles/index.ctp:45 #: Template/Roles/index.ctp:45
@ -1632,7 +1595,6 @@ msgstr ""
#: Template/BlockchainTypes/view.ctp:32 #: Template/BlockchainTypes/view.ctp:32
#: Template/CommunityProfiles/view.ctp:24 #: Template/CommunityProfiles/view.ctp:24
#: Template/ElopageBuys/view.ctp:32 #: Template/ElopageBuys/view.ctp:32
#: Template/Migrations/view.ctp:20
#: Template/OperatorTypes/view.ctp:30 #: Template/OperatorTypes/view.ctp:30
#: Template/OperatorTypes/view.ctp:39 #: Template/OperatorTypes/view.ctp:39
#: Template/Operators/view.ctp:32 #: Template/Operators/view.ctp:32
@ -2194,38 +2156,6 @@ msgstr ""
msgid "Community Server in Entwicklung" msgid "Community Server in Entwicklung"
msgstr "" msgstr ""
#: Template/Migrations/add.ctp:10
#: Template/Migrations/edit.ctp:16
#: Template/Migrations/view.ctp:12
msgid "List Migrations"
msgstr ""
#: Template/Migrations/add.ctp:16
msgid "Add Migration"
msgstr ""
#: Template/Migrations/edit.ctp:22
#: Template/Migrations/view.ctp:10
msgid "Edit Migration"
msgstr ""
#: Template/Migrations/index.ctp:10
#: Template/Migrations/view.ctp:13
msgid "New Migration"
msgstr ""
#: Template/Migrations/index.ctp:14
msgid "Migrations"
msgstr ""
#: Template/Migrations/view.ctp:11
msgid "Delete Migration"
msgstr ""
#: Template/Migrations/view.ctp:24
msgid "Db Version"
msgstr ""
#: Template/OperatorTypes/add.ctp:10 #: Template/OperatorTypes/add.ctp:10
#: Template/OperatorTypes/edit.ctp:16 #: Template/OperatorTypes/edit.ctp:16
#: Template/OperatorTypes/view.ctp:12 #: Template/OperatorTypes/view.ctp:12

View File

@ -1,26 +0,0 @@
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Migration Entity
*
* @property int $id
* @property int|null $db_version
*/
class Migration extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'db_version' => true,
];
}

View File

@ -1,56 +0,0 @@
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* Migrations Model
*
* @method \App\Model\Entity\Migration get($primaryKey, $options = [])
* @method \App\Model\Entity\Migration newEntity($data = null, array $options = [])
* @method \App\Model\Entity\Migration[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\Migration|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Migration saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\Migration patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
* @method \App\Model\Entity\Migration[] patchEntities($entities, array $data, array $options = [])
* @method \App\Model\Entity\Migration findOrCreate($search, callable $callback = null, $options = [])
*/
class MigrationsTable extends Table
{
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->setTable('migrations');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
}
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator
->nonNegativeInteger('id')
->allowEmptyString('id', null, 'create');
$validator
->integer('db_version')
->allowEmptyString('db_version');
return $validator;
}
}

View File

@ -1,23 +0,0 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Migration $migration
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('List Migrations'), ['action' => 'index']) ?></li>
</ul>
</nav>
<div class="migrations form large-9 medium-8 columns content">
<?= $this->Form->create($migration) ?>
<fieldset>
<legend><?= __('Add Migration') ?></legend>
<?php
echo $this->Form->control('db_version');
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>

View File

@ -1,29 +0,0 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Migration $migration
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Form->postLink(
__('Delete'),
['action' => 'delete', $migration->id],
['confirm' => __('Are you sure you want to delete # {0}?', $migration->id)]
)
?></li>
<li><?= $this->Html->link(__('List Migrations'), ['action' => 'index']) ?></li>
</ul>
</nav>
<div class="migrations form large-9 medium-8 columns content">
<?= $this->Form->create($migration) ?>
<fieldset>
<legend><?= __('Edit Migration') ?></legend>
<?php
echo $this->Form->control('db_version');
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>

View File

@ -1,47 +0,0 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Migration[]|\Cake\Collection\CollectionInterface $migrations
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('New Migration'), ['action' => 'add']) ?></li>
</ul>
</nav>
<div class="migrations index large-9 medium-8 columns content">
<h3><?= __('Migrations') ?></h3>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
<th scope="col"><?= $this->Paginator->sort('db_version') ?></th>
<th scope="col" class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($migrations as $migration): ?>
<tr>
<td><?= $this->Number->format($migration->id) ?></td>
<td><?= $this->Number->format($migration->db_version) ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $migration->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $migration->id]) ?>
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $migration->id], ['confirm' => __('Are you sure you want to delete # {0}?', $migration->id)]) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="paginator">
<ul class="pagination">
<?= $this->Paginator->first('<< ' . __('first')) ?>
<?= $this->Paginator->prev('< ' . __('previous')) ?>
<?= $this->Paginator->numbers() ?>
<?= $this->Paginator->next(__('next') . ' >') ?>
<?= $this->Paginator->last(__('last') . ' >>') ?>
</ul>
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
</div>
</div>

View File

@ -1,18 +0,0 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
?><h2>Migrate DB</h2>
<p>Migrate from Version <?= $db_version ?></p>
<?php if($result['success']) : ?>
<h3><success>Success</success></h3>
<?php else : ?>
<h3><error>Error</error></h3>
<p><?= json_encode($result) ?></p>
<?php endif; ?>
<p><?= $this->Html->link('Back to Dashboard', ['controller' => 'Dashboard', 'action' => 'index']) ?></p>

View File

@ -1,28 +0,0 @@
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Migration $migration
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('Edit Migration'), ['action' => 'edit', $migration->id]) ?> </li>
<li><?= $this->Form->postLink(__('Delete Migration'), ['action' => 'delete', $migration->id], ['confirm' => __('Are you sure you want to delete # {0}?', $migration->id)]) ?> </li>
<li><?= $this->Html->link(__('List Migrations'), ['action' => 'index']) ?> </li>
<li><?= $this->Html->link(__('New Migration'), ['action' => 'add']) ?> </li>
</ul>
</nav>
<div class="migrations view large-9 medium-8 columns content">
<h3><?= h($migration->id) ?></h3>
<table class="vertical-table">
<tr>
<th scope="row"><?= __('Id') ?></th>
<td><?= $this->Number->format($migration->id) ?></td>
</tr>
<tr>
<th scope="row"><?= __('Db Version') ?></th>
<td><?= $this->Number->format($migration->db_version) ?></td>
</tr>
</table>
</div>

View File

@ -1,45 +0,0 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* MigrationsFixture
*/
class Migrations2Fixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'db_version' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => '0', 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8mb4_unicode_ci'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->table = "migrations";
$this->records = [
[
'id' => 1,
'db_version' => 3,
],
];
parent::init();
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* MigrationsFixture
*/
class MigrationsFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'db_version' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => '0', 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'utf8mb4_unicode_ci'
],
];
// @codingStandardsIgnoreEnd
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'db_version' => 1,
],
];
parent::init();
}
}

View File

@ -41,7 +41,6 @@ class ApplicationTest extends IntegrationTestCase
$this->assertCount(3, $plugins); $this->assertCount(3, $plugins);
$this->assertSame('Bake', $plugins->get('Bake')->getName()); $this->assertSame('Bake', $plugins->get('Bake')->getName());
$this->assertSame('Migrations', $plugins->get('Migrations')->getName());
$this->assertSame('DebugKit', $plugins->get('DebugKit')->getName()); $this->assertSame('DebugKit', $plugins->get('DebugKit')->getName());
} }

View File

@ -27,8 +27,7 @@ class AppRequestControllerTest extends TestCase
'app.TransactionSignatures', 'app.TransactionSignatures',
'app.TransactionSendCoins', 'app.TransactionSendCoins',
'app.StateBalances', 'app.StateBalances',
'app.TransactionTypes', 'app.TransactionTypes'
'app.Migrations'
]; ];

View File

@ -1,75 +0,0 @@
<?php
namespace App\Test\TestCase\Controller;
use App\Controller\MigrationsController;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
/**
* App\Controller\MigrationsController Test Case
*
* @uses \App\Controller\MigrationsController
*/
class MigrationsControllerTest extends TestCase
{
use IntegrationTestTrait;
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'app.Migrations',
];
/**
* Test index method
*
* @return void
*/
public function testIndex()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test view method
*
* @return void
*/
public function testView()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test add method
*
* @return void
*/
public function testAdd()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test edit method
*
* @return void
*/
public function testEdit()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test delete method
*
* @return void
*/
public function testDelete()
{
$this->markTestIncomplete('Not implemented yet.');
}
}

View File

@ -28,9 +28,7 @@ use Cake\View\Exception\MissingTemplateException;
class PagesControllerTest extends IntegrationTestCase class PagesControllerTest extends IntegrationTestCase
{ {
public $fixtures = [ public $fixtures = [];
'app.Migrations2'
];
/** /**
* testMultipleGet method * testMultipleGet method
* *

View File

@ -1,72 +0,0 @@
<?php
namespace App\Test\TestCase\Model\Table;
use App\Model\Table\MigrationsTable;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
/**
* App\Model\Table\MigrationsTable Test Case
*/
class MigrationsTableTest extends TestCase
{
/**
* Test subject
*
* @var \App\Model\Table\MigrationsTable
*/
public $Migrations;
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'app.Migrations',
];
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
$config = TableRegistry::getTableLocator()->exists('Migrations') ? [] : ['className' => MigrationsTable::class];
$this->Migrations = TableRegistry::getTableLocator()->get('Migrations', $config);
}
/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
unset($this->Migrations);
parent::tearDown();
}
/**
* Test initialize method
*
* @return void
*/
public function testInitialize()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test validationDefault method
*
* @return void
*/
public function testValidationDefault()
{
$this->markTestIncomplete('Not implemented yet.');
}
}