aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations
diff options
context:
space:
mode:
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();
+});