summaryrefslogtreecommitdiff
path: root/migrations/20250819.php
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/20250819.php')
-rw-r--r--migrations/20250819.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/migrations/20250819.php b/migrations/20250819.php
index a0cfd19..b635201 100644
--- a/migrations/20250819.php
+++ b/migrations/20250819.php
@@ -51,7 +51,10 @@ SQL);
Database::getInstance()->query(<<<SQL
create table if not exists "rooms" (
"id" varchar(255) primary key,
- "name" varchar(255) not null
+
+ "name" varchar(255) not null,
+
+ "version" integer not null
);
SQL);
@@ -63,6 +66,7 @@ Database::getInstance()->query(<<<SQL
"sender" varchar(255) not null,
"origin_server_timestamp" timestamptz(3) not null,
+ "state_key" varchar(255),
"data" json,
"content" json,
@@ -75,3 +79,32 @@ Database::getInstance()->query(<<<SQL
foreign key (room_id) references rooms(id)
);
SQL);
+
+Database::getInstance()->query(<<<SQL
+ create table if not exists "room_memberships" (
+ "id" bigserial primary key,
+
+ "room_id" varchar(255) not null,
+ "user_id" varchar(255) not null,
+
+ "state" varchar(255) not null,
+
+ foreign key (room_id) references rooms(id),
+ foreign key (user_id) references users(id)
+ );
+SQL);
+
+Database::getInstance()->query(<<<SQL
+ create table if not exists "filters" (
+ "id" varchar(255) primary key,
+ "account_data" jsonb,
+ "event_fields" jsonb,
+ "event_format" varchar(255),
+ "presence" jsonb,
+ "room" jsonb,
+
+ "user_id" varchar(255) not null,
+
+ foreign key (user_id) references users(id)
+ );
+SQL);