aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations/20241207_183000_create_actor.php
diff options
context:
space:
mode:
authorwinter2024-12-07 21:44:42 +0000
committerwinter2024-12-07 21:44:42 +0000
commita84232811dadccf7047424f27340a7f9847bedff (patch)
treea6a0823c8b9485b6a5b60ea7ae854f9511a6ae1e /migrations/20241207_183000_create_actor.php
parente1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 (diff)
many many changes but actors are loaded from db now
Diffstat (limited to 'migrations/20241207_183000_create_actor.php')
-rw-r--r--migrations/20241207_183000_create_actor.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/migrations/20241207_183000_create_actor.php b/migrations/20241207_183000_create_actor.php
new file mode 100644
index 0000000..08de53d
--- /dev/null
+++ b/migrations/20241207_183000_create_actor.php
@@ -0,0 +1,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);
+});