update skeema files, adding roles, belong to samirs work

This commit is contained in:
team-devstage 2020-10-26 15:39:59 +01:00
parent 0a9a0ebed5
commit 68a3400f51
26 changed files with 124 additions and 111 deletions

@ -1 +1 @@
Subproject commit 21d4a0a5e9a19f251e26c0ae07ce74be2fa99bbf
Subproject commit a04d4769974b9d93ba72e490ed7dca3fbaed768c

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,6 @@
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `roles_id_IDX` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,6 @@
CREATE TABLE `state_user_roles` (
`id` int(11) 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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

@ -1 +1 @@
Subproject commit 81a461566e46d71533dc3e284fa075d7d68fd020
Subproject commit 9004e6978ac3dafcc635b2ffcf8bc6a156451cca