Skip to content

Commit

Permalink
Merge pull request #1336 from krgauraw/questionset_db
Browse files Browse the repository at this point in the history
Issue #SC-2141 feat: added cassandra script
  • Loading branch information
amorphous-1 authored Feb 17, 2021
2 parents 8e43a1d + 92669d7 commit 1a3eef1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/inventory/env/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ hierarchy_keyspace_name: "{{instance}}_hierarchy_store"
dialcode_keyspace_name: "{{instance}}_dialcode_store"
category_keyspace_name: "{{instance}}_category_store"
assessment_keyspace_name: "{{instance}}_question_store"
question_keyspace_name: "{{instance}}_question_store"


dp_cassandra_connection: "{{ groups['dp-cassandra'][0] }}:9042"
Expand Down
24 changes: 24 additions & 0 deletions ansible/roles/cassandra-db-update/templates/data.cql.j2
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,27 @@ CREATE TABLE IF NOT EXISTS {{ category_keyspace_name }}.category_definition_data
objectmetadata map<text, text>
);

CREATE KEYSPACE IF NOT EXISTS {{ question_keyspace_name }} WITH replication = {
'class': 'NetworkTopologyStrategy',
'datacenter1': '2'
};

CREATE TABLE IF NOT EXISTS {{ question_keyspace_name }}.question_data (
identifier text,
body blob,
editorState text,
answer blob,
solutions text,
instructions text,
hints text,
media text,
responseDeclaration text,
interactions text,
PRIMARY KEY (identifier)
);

CREATE TABLE IF NOT EXISTS {{ hierarchy_keyspace_name }}.questionset_hierarchy (
identifier text,
hierarchy text,
PRIMARY KEY (identifier)
);

0 comments on commit 1a3eef1

Please sign in to comment.