Skip to content

Commit

Permalink
Issue #LR-716 chore: Added if not exists clause in cassandra query. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AmiableAnil authored Dec 26, 2023
1 parent 19f28f8 commit a2fbc69
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion sunbird-cassandra-migration/cassandra-migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cassandra@cqlsh:cassandra_migration_test> select * from cassandra_migration_vers
### .cql files
Example:
```
CREATE TABLE test1 (
CREATE TABLE IF NOT EXISTS test1 (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE sunbird.user_roles(
CREATE TABLE IF NOT EXISTS sunbird.user_roles(
userid text,
role text,
scope text,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO sunbird.email_template(name, template) VALUES('otpEmailDeleteUserTemplate', '<html><head><meta name="viewport" content="width=device-width"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><style>@media only screen and (max-width:620px){table[class=body] h1{font-size:28px!important;margin-bottom:10px!important}table[class=body] a,table[class=body] ol,table[class=body] p,table[class=body] span,table[class=body] td,table[class=body] ul{font-size:16px!important}table[class=body] .article,table[class=body] .wrapper{padding:10px!important}table[class=body] .content{padding:0!important}table[class=body] .container{padding:0!important;width:100%!important}table[class=body] .main{border-left-width:0!important;border-radius:0!important;border-right-width:0!important}table[class=body] .btn table{width:100%!important}table[class=body] .btn a{width:100%!important}table[class=body] .img-responsive{height:auto!important;max-width:100%!important;width:auto!important}}@media all{.ExternalClass{width:100%}.ExternalClass,.ExternalClass div,.ExternalClass font,.ExternalClass p,.ExternalClass span,.ExternalClass td{line-height:100%}.apple-link a{color:inherit!important;font-family:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;text-decoration:none!important}}</style></head><body class="" style="color:#000!important;background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%"><table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse:separate;mso-table-lspace:0;mso-table-rspace:0;width:100%;background-color:#f6f6f6"><tbody><tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top">&nbsp;</td><td class="container" style="font-family:sans-serif;font-size:14px;vertical-align:top;display:block;Margin:0 auto;max-width:580px;padding:10px;width:580px"><div class="content" style="box-sizing:border-box;display:block;Margin:0 auto;max-width:580px;padding:10px"><span class="preheader" style="color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0"></span><table class="main" style="border-collapse:separate;mso-table-lspace:0;mso-table-rspace:0;width:100%;background:#fff;border-radius:3px"><tbody><tr><td class="wrapper" style="font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse:separate;mso-table-lspace:0;mso-table-rspace:0;width:100%"><tbody><tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top"><table border="0" cellpadding="0" cellspacing="0" class="btn btn-primary" style="border-collapse:separate;mso-table-lspace:0;mso-table-rspace:0;width:100%;box-sizing:border-box"><tbody><tr><td align="left" style="font-family:sans-serif;font-size:14px;vertical-align:top;font-family:sans-serif;font-size:14px;font-weight:400;margin:0;Margin-bottom:15px">Hello User,<br><p>To confirm the deletion of your $installationName account, please enter the following OTP: $otp.</p><p>This OTP is valid for the next $otpExpiryInMinutes.</p><p>If you did not request this account deletion, please ignore this message or contact our support team immediately at $supportEmail.</p><p>Thank you for using $installationName.</p>Best regards,<br>The $installationName Team</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td><td style="font-family:sans-serif;font-size:14px;vertical-align:top">&nbsp;</td></tr></tbody></table></body></html>');
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ALTER TABLE sunbird.user ADD prevUsedPhone text;
ALTER TABLE sunbird.user ADD prevUsedEmail text;
CREATE TABLE sunbird.user_cert (id text,certId text,userId text,store map<text,text>,otherLink text,accessCode text,createdAt timestamp, updatedAt timestamp, PRIMARY KEY (id));
CREATE TABLE IF NOT EXISTS sunbird.user_cert (id text,certId text,userId text,store map<text,text>,otherLink text,accessCode text,createdAt timestamp, updatedAt timestamp, PRIMARY KEY (id));
CREATE INDEX inx_usrcert_user_id ON sunbird.user_cert(userId);
CREATE INDEX inx_usrcert_cert_id ON sunbird.user_cert(certId);

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ createdBy text,
lastUpdatedBy text,
PRIMARY KEY(templateId));

CREATE TABLE sunbird_notifications.notification_feed (
CREATE TABLE IF NOT EXISTS sunbird_notifications.notification_feed (
id text PRIMARY KEY,
category text,
createdby text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test (
CREATE TABLE IF NOT EXISTS test (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test1 (
CREATE TABLE IF NOT EXISTS test1 (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
created timestamp
);

CREATE TABLE messages (
CREATE TABLE IF NOT EXISTS messages (
id bigint PRIMARY KEY,
contents_id bigint,
type int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test1 (
CREATE TABLE IF NOT EXISTS test1 (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
created timestamp
);

CREATE TABLE messages (
CREATE TABLE IF NOT EXISTS messages (
id bigint PRIMARY KEY,
contents_id bigint,
type int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test1 (
CREATE TABLE IF NOT EXISTS test1 (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
created timestamp
);

CREATE TABLE messages (
CREATE TABLE IF NOT EXISTS messages (
id bigint PRIMARY KEY,
contents_id bigint,
type int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test1 (
CREATE TABLE IF NOT EXISTS test1 (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
created timestamp
);

CREATE TABLE messages (
CREATE TABLE IF NOT EXISTS messages (
id bigint PRIMARY KEY,
contents_id bigint,
type int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE test (
CREATE TABLE IF NOT EXISTS test (
space text,
key text,
value text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE contents (
CREATE TABLE IF NOT EXISTS contents (
id bigint PRIMARY KEY,
title text,
message text,
Expand Down

0 comments on commit a2fbc69

Please sign in to comment.