aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations/20241207_183000_create_actor.php
blob: 08de53db3a3d68a616a152e870dee6672cb90385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

use \WpfTest\Db\Migrator;

Migrator::getInstance()->register(20241207_183000, function (PDO $db) {
    // create actor, endpoints, extensions
    $db->exec(<<<'END'
    CREATE TABLE actor (
        id bigserial primary key not null,
        uri text unique not null,
        is_local boolean not null,
        created timestamp with time zone not null,
        modified timestamp with time zone,
        homepage text,
        handle text not null,
        display_name text not null,
        bio text,
        pronouns text,
        automated boolean not null default false,
        request_to_follow boolean not null default false
    );
    CREATE TABLE actor_endpoints (
        actor_id bigint unique not null references actor(id),
        basic_feed text not null,
        full_feed text,
        follow text,
        unfollow text,
        block text,
        unblock text,
        subscribe text,
        unsubscribe text
    );
    CREATE TABLE actor_extension (
        actor_id bigint not null references actor(id),
        uri text not null,
        data jsonb not null,
        unique(actor_id, uri)
    );
    END);
});