aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations
diff options
context:
space:
mode:
authorwinter2024-12-13 23:53:23 +0000
committerwinter2024-12-13 23:53:23 +0000
commit2713c1f73a39d4106936d4c52bf8f18d810d7f3c (patch)
treeca3ab4c78b7a45fe4ddc218ce4e45f181cd179e2 /migrations
parentae37b73d1f15ffe5c4c9a32c5de349cd746ebc48 (diff)
add instance information
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20241213_164314_create_instance.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/migrations/20241213_164314_create_instance.php b/migrations/20241213_164314_create_instance.php
new file mode 100644
index 0000000..fdd2f22
--- /dev/null
+++ b/migrations/20241213_164314_create_instance.php
@@ -0,0 +1,33 @@
+<?php
+
+use \Digitigrade\Db\Migrator;
+
+Migrator::getInstance()->register(20241213_164314, function (PDO $db) {
+ // table of instance information
+ // also decided to move (un)subscribe endpoints to be global instead of actor-specific
+ // hope to yourself that there wasn't any data in those because im too lazy to move it properly lol
+ $db->beginTransaction();
+ $db->exec(<<<END
+ CREATE TABLE instance (
+ id bigserial primary key,
+ domain text not null unique,
+ name text not null,
+ description text,
+ icon text,
+ software_name text not null,
+ software_description text,
+ software_version text,
+ software_homepage text
+ );
+ CREATE TABLE instance_endpoints (
+ instance_id bigint not null references instance,
+ auth text,
+ report text,
+ subscribe text,
+ unsubscribe text
+ );
+ ALTER TABLE actor_endpoints DROP COLUMN subscribe;
+ ALTER TABLE actor_endpoints DROP COLUMN unsubscribe;
+ END);
+ $db->commit();
+});