diff --git a/skeema/gradido_community/admin_errors.sql b/skeema/gradido_community/admin_errors.sql index 877b1d7db..020b4078b 100644 --- a/skeema/gradido_community/admin_errors.sql +++ b/skeema/gradido_community/admin_errors.sql @@ -1,5 +1,5 @@ CREATE TABLE `admin_errors` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `state_user_id` int(11) NOT NULL, `controller` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, diff --git a/skeema/gradido_community/community_profiles.sql b/skeema/gradido_community/community_profiles.sql index ce77b6ead..07d475fdf 100644 --- a/skeema/gradido_community/community_profiles.sql +++ b/skeema/gradido_community/community_profiles.sql @@ -1,8 +1,9 @@ CREATE TABLE `community_profiles` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `state_user_id` INT UNSIGNED NOT NULL, - `profile_img` LONGBLOB NULL, - `profile_desc` VARCHAR(2000) NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_user_id` int(10) unsigned NOT NULL, + `profile_img` longblob, + `profile_desc` varchar(2000) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), - FOREIGN KEY (`state_user_id`) REFERENCES `state_users`(`id`) -) ENGINE=InnoDB; + KEY `state_user_id` (`state_user_id`), + CONSTRAINT `community_profiles_ibfk_1` FOREIGN KEY (`state_user_id`) REFERENCES `state_users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/operator_types.sql b/skeema/gradido_community/operator_types.sql index ccf779b0b..35df5264e 100644 --- a/skeema/gradido_community/operator_types.sql +++ b/skeema/gradido_community/operator_types.sql @@ -1,6 +1,6 @@ CREATE TABLE `operator_types` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(25) NOT NULL, - `text` varchar(255) NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL, + `text` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/operators.sql b/skeema/gradido_community/operators.sql index e995ff25e..74808be9b 100644 --- a/skeema/gradido_community/operators.sql +++ b/skeema/gradido_community/operators.sql @@ -1,8 +1,8 @@ CREATE TABLE `operators` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `username` varchar(50) NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `user_pubkey` binary(32) NOT NULL, - `data_base64` varchar(255) NOT NULL, + `data_base64` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `modified` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/pending_transactions.sql b/skeema/gradido_community/pending_transactions.sql index b3f94f38f..e3d6a4a08 100644 --- a/skeema/gradido_community/pending_transactions.sql +++ b/skeema/gradido_community/pending_transactions.sql @@ -1,10 +1,10 @@ CREATE TABLE `pending_transactions` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transactionID` varchar(25) NOT NULL, - `service` varchar(20) NOT NULL, - `method` varchar(20) NOT NULL, - `h_server_id` int NOT NULL, - `timeout` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transactionID` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL, + `service` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `method` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `h_server_id` int(11) NOT NULL, + `timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `transactionID` (`transactionID`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/roles.sql b/skeema/gradido_community/roles.sql new file mode 100644 index 000000000..9fe9de710 --- /dev/null +++ b/skeema/gradido_community/roles.sql @@ -0,0 +1,5 @@ +CREATE TABLE `roles` ( + `id` int UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/server_users.sql b/skeema/gradido_community/server_users.sql index 801eacef0..982a4bdc3 100644 --- a/skeema/gradido_community/server_users.sql +++ b/skeema/gradido_community/server_users.sql @@ -1,12 +1,12 @@ CREATE TABLE `server_users` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `username` varchar(50) NOT NULL, - `password` varchar(255) NOT NULL, - `email` varchar(50) NOT NULL, - `role` varchar(20) NOT NULL DEFAULT 'admin', - `activated` tinyint NOT NULL DEFAULT 0, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `role` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'admin', + `activated` tinyint(4) NOT NULL DEFAULT '0', `last_login` datetime DEFAULT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_balances.sql b/skeema/gradido_community/state_balances.sql index 9afb308ac..c8b013d44 100644 --- a/skeema/gradido_community/state_balances.sql +++ b/skeema/gradido_community/state_balances.sql @@ -1,7 +1,7 @@ CREATE TABLE `state_balances` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `state_user_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_user_id` int(10) unsigned NOT NULL, `modified` datetime NOT NULL, - `amount` bigint NOT NULL, + `amount` bigint(20) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_created.sql b/skeema/gradido_community/state_created.sql index 05a2a8c97..5bc139594 100644 --- a/skeema/gradido_community/state_created.sql +++ b/skeema/gradido_community/state_created.sql @@ -1,11 +1,11 @@ CREATE TABLE `state_created` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, - `month` tinyint UNSIGNED NOT NULL, - `year` smallint UNSIGNED NOT NULL, - `state_user_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, + `month` tinyint(3) unsigned NOT NULL, + `year` smallint(5) unsigned NOT NULL, + `state_user_id` int(10) unsigned NOT NULL, `created` datetime NOT NULL, - `short_ident_hash` int UNSIGNED NOT NULL, + `short_ident_hash` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `short_ident_hash` (`short_ident_hash`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_errors.sql b/skeema/gradido_community/state_errors.sql index 141e97562..8088f6ed2 100644 --- a/skeema/gradido_community/state_errors.sql +++ b/skeema/gradido_community/state_errors.sql @@ -1,8 +1,8 @@ CREATE TABLE `state_errors` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `state_user_id` int UNSIGNED NOT NULL, - `transaction_type_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `state_user_id` int(10) unsigned NOT NULL, + `transaction_type_id` int(10) unsigned NOT NULL, `created` datetime NOT NULL, - `message_json` text NOT NULL, + `message_json` text COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_group_addresses.sql b/skeema/gradido_community/state_group_addresses.sql index 38e8c36a8..1d256f3e0 100644 --- a/skeema/gradido_community/state_group_addresses.sql +++ b/skeema/gradido_community/state_group_addresses.sql @@ -1,7 +1,7 @@ CREATE TABLE `state_group_addresses` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `group_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `group_id` int(10) unsigned NOT NULL, `public_key` binary(32) NOT NULL, - `address_type_id` int UNSIGNED NOT NULL, + `address_type_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_group_relationships.sql b/skeema/gradido_community/state_group_relationships.sql index 19f7f5752..d2eecbfc0 100644 --- a/skeema/gradido_community/state_group_relationships.sql +++ b/skeema/gradido_community/state_group_relationships.sql @@ -1,7 +1,7 @@ CREATE TABLE `state_group_relationships` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `group1_id` int UNSIGNED NOT NULL, - `group2_id` int UNSIGNED NOT NULL, - `state_relationship_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `group1_id` int(10) unsigned NOT NULL, + `group2_id` int(10) unsigned NOT NULL, + `state_relationship_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_groups.sql b/skeema/gradido_community/state_groups.sql index 1ac95ec6c..30a810a19 100644 --- a/skeema/gradido_community/state_groups.sql +++ b/skeema/gradido_community/state_groups.sql @@ -1,8 +1,8 @@ CREATE TABLE `state_groups` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `index_id` varbinary(64) NOT NULL, - `name` varchar(50) NOT NULL, + `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `root_public_key` binary(32) NOT NULL, - `user_count` smallint UNSIGNED NOT NULL DEFAULT 0, + `user_count` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_relationship_types.sql b/skeema/gradido_community/state_relationship_types.sql index 99c428afd..fd901b8ac 100644 --- a/skeema/gradido_community/state_relationship_types.sql +++ b/skeema/gradido_community/state_relationship_types.sql @@ -1,6 +1,6 @@ CREATE TABLE `state_relationship_types` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(25) NOT NULL, - `text` varchar(255) DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL, + `text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_user_roles.sql b/skeema/gradido_community/state_user_roles.sql new file mode 100644 index 000000000..207c2de63 --- /dev/null +++ b/skeema/gradido_community/state_user_roles.sql @@ -0,0 +1,6 @@ +CREATE TABLE `state_user_roles` ( + `id` int UNSIGNED NOT NULL AUTO_INCREMENT, + `state_user_id` int(11) NOT NULL, + `role_id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/state_users.sql b/skeema/gradido_community/state_users.sql index ca1f4c022..706fa699e 100644 --- a/skeema/gradido_community/state_users.sql +++ b/skeema/gradido_community/state_users.sql @@ -1,13 +1,13 @@ CREATE TABLE `state_users` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `index_id` smallint NOT NULL DEFAULT 0, - `group_id` int UNSIGNED NOT NULL DEFAULT 0, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `index_id` smallint(6) NOT NULL DEFAULT '0', + `group_id` int(10) unsigned NOT NULL DEFAULT '0', `public_key` binary(32) NOT NULL, - `email` varchar(255) DEFAULT NULL, - `first_name` varchar(255) DEFAULT NULL, - `last_name` varchar(255) DEFAULT NULL, - `username` varchar(255) DEFAULT NULL, - `disabled` tinyint DEFAULT 0, + `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `first_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `disabled` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `public_key` (`public_key`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_creations.sql b/skeema/gradido_community/transaction_creations.sql index 0fcb92582..a2ff37539 100644 --- a/skeema/gradido_community/transaction_creations.sql +++ b/skeema/gradido_community/transaction_creations.sql @@ -1,9 +1,9 @@ CREATE TABLE `transaction_creations` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, - `state_user_id` int UNSIGNED NOT NULL, - `amount` bigint NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, + `state_user_id` int(10) unsigned NOT NULL, + `amount` bigint(20) NOT NULL, `ident_hash` binary(32) NOT NULL, `target_date` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_group_addaddress.sql b/skeema/gradido_community/transaction_group_addaddress.sql index 1c6fe826c..dceac273c 100644 --- a/skeema/gradido_community/transaction_group_addaddress.sql +++ b/skeema/gradido_community/transaction_group_addaddress.sql @@ -1,7 +1,7 @@ CREATE TABLE `transaction_group_addaddress` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, - `address_type_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, + `address_type_id` int(10) unsigned NOT NULL, `public_key` binary(32) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_group_allowtrades.sql b/skeema/gradido_community/transaction_group_allowtrades.sql index e2c299b34..923e0d5d0 100644 --- a/skeema/gradido_community/transaction_group_allowtrades.sql +++ b/skeema/gradido_community/transaction_group_allowtrades.sql @@ -1,7 +1,7 @@ CREATE TABLE `transaction_group_allowtrades` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, `remote_group_id` varbinary(64) NOT NULL, - `allow` tinyint NOT NULL DEFAULT 0, + `allow` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_group_creates.sql b/skeema/gradido_community/transaction_group_creates.sql index afb8caf88..b5d7629b4 100644 --- a/skeema/gradido_community/transaction_group_creates.sql +++ b/skeema/gradido_community/transaction_group_creates.sql @@ -1,8 +1,8 @@ CREATE TABLE `transaction_group_creates` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, `group_public_key` binary(32) NOT NULL, - `group_id` varchar(64) NOT NULL, - `name` varchar(64) NOT NULL, + `group_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_send_coins.sql b/skeema/gradido_community/transaction_send_coins.sql index d55d57b51..f57a2175e 100644 --- a/skeema/gradido_community/transaction_send_coins.sql +++ b/skeema/gradido_community/transaction_send_coins.sql @@ -1,10 +1,10 @@ CREATE TABLE `transaction_send_coins` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, - `state_user_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, + `state_user_id` int(10) unsigned NOT NULL, `receiver_public_key` binary(32) NOT NULL, - `receiver_user_id` int UNSIGNED NOT NULL, - `amount` bigint NOT NULL, - `sender_final_balance` bigint NOT NULL, + `receiver_user_id` int(10) unsigned NOT NULL, + `amount` bigint(20) NOT NULL, + `sender_final_balance` bigint(20) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_signatures.sql b/skeema/gradido_community/transaction_signatures.sql index 2e8507c23..0c13b77da 100644 --- a/skeema/gradido_community/transaction_signatures.sql +++ b/skeema/gradido_community/transaction_signatures.sql @@ -1,7 +1,7 @@ CREATE TABLE `transaction_signatures` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `transaction_id` int UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `transaction_id` int(10) unsigned NOT NULL, `signature` binary(64) NOT NULL, `pubkey` binary(32) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transaction_types.sql b/skeema/gradido_community/transaction_types.sql index 4d1c13b55..87492e1fe 100644 --- a/skeema/gradido_community/transaction_types.sql +++ b/skeema/gradido_community/transaction_types.sql @@ -1,6 +1,6 @@ CREATE TABLE `transaction_types` ( - `id` int UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(24) NOT NULL, - `text` varchar(255) NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(24) COLLATE utf8mb4_unicode_ci NOT NULL, + `text` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/skeema/gradido_community/transactions.sql b/skeema/gradido_community/transactions.sql index c6072d20c..0e8c00ce6 100644 --- a/skeema/gradido_community/transactions.sql +++ b/skeema/gradido_community/transactions.sql @@ -1,9 +1,9 @@ CREATE TABLE `transactions` ( - `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, - `state_group_id` int UNSIGNED DEFAULT NULL, - `transaction_type_id` int UNSIGNED NOT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `state_group_id` int(10) unsigned DEFAULT NULL, + `transaction_type_id` int(10) unsigned NOT NULL, `tx_hash` binary(32) DEFAULT NULL, - `memo` varchar(255) NOT NULL, - `received` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `memo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `received` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/src/Controller/JsonRequestHandlerController.php b/src/Controller/JsonRequestHandlerController.php index 89d07a93f..f72d5d947 100644 --- a/src/Controller/JsonRequestHandlerController.php +++ b/src/Controller/JsonRequestHandlerController.php @@ -58,11 +58,29 @@ class JsonRequestHandlerController extends AppController { case 'checkUser': return $this->checkUser($jsonData->email, $jsonData->last_name); case 'getUsers' : return $this->getUsers($jsonData->page, $jsonData->limit); case 'getUserBalance': return $this->getUserBalance($jsonData->email, $jsonData->last_name); + case 'errorInTransaction': return $this->errorInTransaction($jsonData->created, $jsonData->transactionGenericHash, $jsonData->error, $jsonData->errorMessage); } return $this->returnJson(['state' => 'error', 'msg' => 'unknown method for post', 'details' => $method]); } return $this->returnJson(['state' => 'error', 'msg' => 'no post or get']); } + + //! \param $transactionCreated creation of transaction in timestamp in seconds + //! -1 if transaction couldn't decode + //! \param $transactionBodyBase64Sha256 generic hash from transaction body serialized and converted to base64 + //! using sodium_crypto_generichash to calculate + // hash also in base64 format + //! \param $error short error name in user language + //! \param $errorDetails more detailed error message in user language + private function errorInTransaction($transactionCreated, $transactionBodyBase64GenericHash, $error, $errorDetails) { + /* + * payload.set("created", created); + * payload.set("id", task_model->getID()); + * payload.set("public_key", user_model->getPublicKeyHex()); + * payload.set("error", error); + * payload.set("errorMessage", errorDetails); + */ + } private function putTransaction($transactionBase64) { $transaction = new Transaction($transactionBase64); diff --git a/src/Template/Pages/visitor.ctp b/src/Template/Pages/visitor.ctp new file mode 100644 index 000000000..e6956c97c --- /dev/null +++ b/src/Template/Pages/visitor.ctp @@ -0,0 +1,16 @@ +layout = false;?> + + + + Visitor Page + + + + +
Info Page for Visitor to learn about group before try to enter or connect (befriend)
+ +