From 57319599de527798c87733c4b25f19757ab90f8f Mon Sep 17 00:00:00 2001 From: Samuel Hawksby-Robinson Date: Sun, 19 Jul 2020 15:06:58 +0100 Subject: [PATCH] created emoji_reaction table migration Signed-off-by: Samuel Hawksby-Robinson --- .../sqlite/1594390919_add_emoji_reaction_data.down.sql | 0 .../sqlite/1594390919_add_emoji_reaction_data.up.sql | 3 --- .../1594390919_create_emoji_reaction_table.down.sql | 1 + .../sqlite/1594390919_create_emoji_reactions_table.up.sql | 8 ++++++++ 4 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.down.sql delete mode 100644 protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.up.sql create mode 100644 protocol/migrations/sqlite/1594390919_create_emoji_reaction_table.down.sql create mode 100644 protocol/migrations/sqlite/1594390919_create_emoji_reactions_table.up.sql diff --git a/protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.down.sql b/protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.down.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.up.sql b/protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.up.sql deleted file mode 100644 index 6c1709e79..000000000 --- a/protocol/migrations/sqlite/1594390919_add_emoji_reaction_data.up.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE user_messages ADD COLUMN emoji_reaction_target VARCHAR; -ALTER TABLE user_messages ADD COLUMN emoji_reaction_type INT; -ALTER TABLE user_messages ADD COLUMN emoji_reaction_retraction_target VARCHAR; diff --git a/protocol/migrations/sqlite/1594390919_create_emoji_reaction_table.down.sql b/protocol/migrations/sqlite/1594390919_create_emoji_reaction_table.down.sql new file mode 100644 index 000000000..e2effcfc6 --- /dev/null +++ b/protocol/migrations/sqlite/1594390919_create_emoji_reaction_table.down.sql @@ -0,0 +1 @@ +DROP TABLE emoji_reactions; \ No newline at end of file diff --git a/protocol/migrations/sqlite/1594390919_create_emoji_reactions_table.up.sql b/protocol/migrations/sqlite/1594390919_create_emoji_reactions_table.up.sql new file mode 100644 index 000000000..46e49b4b0 --- /dev/null +++ b/protocol/migrations/sqlite/1594390919_create_emoji_reactions_table.up.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS emoji_reactions ( + id VARCHAR PRIMARY KEY ON CONFLICT REPLACE, + clock_value INT NOT NULL, + source TEXT NOT NULL, + emoji_id INT NOT NULL, + message_id VARCHAR NOT NULL, + retracted INT DEFAULT 0 +); \ No newline at end of file