Skip to content

Commit

Permalink
fix: db queries in test cases fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Nov 10, 2023
1 parent 38c6be8 commit ac015b6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
12 changes: 9 additions & 3 deletions packages/restapi/tests/lib/benchmark/chat_members.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ SET time_zone = "+00:00";
-- Table structure for table `chat_members`
--

CREATE TABLE `chat_members` (
`id` int(11) NOT NULL,
CREATE TABLE IF NOT EXISTS `chat_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`chat_id` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`role` varchar(255) NOT NULL,
`intent` tinyint(1) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `chat_address_unique` (`chat_id`,`address`),
KEY `chat_id_idx` (`chat_id`),
KEY `address_idx` (`address`),
KEY `idx_chat_id_intent` (`chat_id`,`intent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


--
-- Dumping data for table `chat_members`
--
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/tests/lib/benchmark/w2w.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SET time_zone = "+00:00";
-- Table structure for table `w2w`
--

CREATE TABLE `w2w` (
CREATE TABLE IF NOT EXISTS `w2w` (
`id` int(11) UNSIGNED NOT NULL,
`combined_did` mediumtext NOT NULL,
`threadhash` varchar(255) DEFAULT NULL,
Expand Down
42 changes: 22 additions & 20 deletions packages/restapi/tests/lib/benchmark/w2w_meta.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,28 @@ SET time_zone = "+00:00";
-- Table structure for table `w2w_meta`
--

CREATE TABLE `w2w_meta` (
`id` int(11) UNSIGNED NOT NULL,
`did` varchar(255) NOT NULL,
`wallets` longtext,
`profile_picture` varchar(512) DEFAULT NULL,
`about` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`pgp_pub` text NOT NULL,
`pgp_priv_enc` text NOT NULL,
`pgp_enc_type` text NOT NULL,
`nft_owner` varchar(255) DEFAULT NULL,
`signature` text NOT NULL,
`sig_type` text NOT NULL,
`linked_list_hash` longtext NOT NULL,
`num_msg` int(11) UNSIGNED DEFAULT '0',
`allowed_num_msg` int(11) UNSIGNED DEFAULT '0',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`verification_proof` text,
`profile` text,
`origin` varchar(255) DEFAULT NULL
CREATE TABLE IF NOT EXISTS w2w_meta (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
did varchar(255) NOT NULL,
wallets longtext,
profile_picture varchar(512) DEFAULT NULL,
about varchar(255) DEFAULT NULL,
name varchar(255) DEFAULT NULL,
pgp_pub text NOT NULL,
pgp_priv_enc text NOT NULL,
pgp_enc_type text NOT NULL,
nft_owner varchar(255) DEFAULT NULL,
signature text NOT NULL,
sig_type text NOT NULL,
linked_list_hash longtext NOT NULL,
num_msg int(11) unsigned DEFAULT '0',
allowed_num_msg int(11) unsigned DEFAULT '0',
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
verification_proof text,
profile text,
origin varchar(255) DEFAULT NULL,
PRIMARY KEY (id),
KEY did_idx (did)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
Expand Down

0 comments on commit ac015b6

Please sign in to comment.