diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2026-04-14 16:33:04 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2026-04-14 16:33:04 +0200 |
| commit | f3202403339e94f0186b9ff19e83c7a32fdad198 (patch) | |
| tree | c3310b1f456f12a7a92f51948d9c8caf94f11032 /migrations | |
| parent | 875b9ece501de5937993c41a83c44f8ea59897d0 (diff) | |
implementing against Cinny and iamb some more
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/20250819.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/migrations/20250819.php b/migrations/20250819.php index b635201..3476081 100644 --- a/migrations/20250819.php +++ b/migrations/20250819.php @@ -54,7 +54,7 @@ Database::getInstance()->query(<<<SQL "name" varchar(255) not null, - "version" integer not null + "version" text not null ); SQL); @@ -96,7 +96,7 @@ SQL); Database::getInstance()->query(<<<SQL create table if not exists "filters" ( - "id" varchar(255) primary key, + "id" varchar(255) not null, "account_data" jsonb, "event_fields" jsonb, "event_format" varchar(255), @@ -105,6 +105,39 @@ Database::getInstance()->query(<<<SQL "user_id" varchar(255) not null, + primary key (id, user_id), foreign key (user_id) references users(id) ); SQL); + +Database::getInstance()->query(<<<SQL + create table if not exists "device_keys" ( + "supported_algorithms" json not null, + "keys" json not null, + "signatures" json not null, + + "user_id" text not null, + "device_id" text not null, + + foreign key (user_id, device_id) references devices(user_id, id) + ); +SQL); + +Database::getInstance()->query(<<<SQL + create table if not exists "one_time_keys" ( + "id" text not null, + + "key" text not null, + "algorithm" text not null, + + "signature_key" text not null, + "signature_algorithm" text not null, + + "is_fallback" bool not null default false, + + "user_id" text not null, + "device_id" text not null, + + foreign key (user_id, device_id) references devices(user_id, id) + ); +SQL); |
