Skip to content

Commit

Permalink
Add missing migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfariello committed Mar 7, 2024
1 parent dc8c43c commit f14df0a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions migrations/2024-02-15-141206_omemo_store/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DROP TABLE omemo_identity;
DROP TABLE omemo_session;
DROP TABLE omemo_pre_key;
DROP TABLE omemo_signed_pre_key;
DROP TABLE omemo_sender_key;
43 changes: 43 additions & 0 deletions migrations/2024-02-15-141206_omemo_store/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
CREATE TABLE omemo_identity (
identity_pk INTEGER PRIMARY KEY NOT NULL,
account VARCHAR NOT NULL,
user_id VARCHAR NOT NULL,
device_id BIGINT NOT NULL,
identity BLOB NOT NULL,
UNIQUE(account, user_id, device_id)
);

CREATE TABLE omemo_session (
session_pk INTEGER PRIMARY KEY NOT NULL,
account VARCHAR NOT NULL,
user_id VARCHAR NOT NULL,
device_id BIGINT NOT NULL,
session BLOB NOT NULL,
UNIQUE(account, user_id, device_id)
);

CREATE TABLE omemo_pre_key (
pre_key_pk INTEGER PRIMARY KEY NOT NULL,
account VARCHAR NOT NULL,
pre_key_id BIGINT NOT NULL,
pre_key BLOB NOT NULL,
UNIQUE(account, pre_key_id)
);

CREATE TABLE omemo_signed_pre_key (
signed_pre_key_pk INTEGER PRIMARY KEY NOT NULL,
account VARCHAR NOT NULL,
signed_pre_key_id BIGINT NOT NULL,
signed_pre_key BLOB NOT NULL,
UNIQUE(account, signed_pre_key_id)
);

CREATE TABLE omemo_sender_key (
sender_key_pk INTEGER PRIMARY KEY NOT NULL,
account VARCHAR NOT NULL,
sender_id VARCHAR NOT NULL,
device_id BIGINT NOT NULL,
distribution_id BLOB NOT NULL,
sender_key BLOB NOT NULL,
UNIQUE(account, sender_id, device_id, distribution_id)
);

0 comments on commit f14df0a

Please sign in to comment.