summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20170423154511_add_fields_to_users.exs10
-rw-r--r--priv/repo/migrations/20170426154155_create_websub_client_subscription.exs15
-rw-r--r--priv/repo/migrations/20170427054757_add_user_and_hub.exs10
-rw-r--r--priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs8
-rw-r--r--priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs10
-rw-r--r--priv/repo/migrations/20170502083023_add_local_field_to_activities.exs11
6 files changed, 64 insertions, 0 deletions
diff --git a/priv/repo/migrations/20170423154511_add_fields_to_users.exs b/priv/repo/migrations/20170423154511_add_fields_to_users.exs
new file mode 100644
index 000000000..84de74bc4
--- /dev/null
+++ b/priv/repo/migrations/20170423154511_add_fields_to_users.exs
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.AddFieldsToUsers do
+ use Ecto.Migration
+
+ def change do
+ alter table(:users) do
+ add :local, :boolean, default: true
+ add :info, :map
+ end
+ end
+end
diff --git a/priv/repo/migrations/20170426154155_create_websub_client_subscription.exs b/priv/repo/migrations/20170426154155_create_websub_client_subscription.exs
new file mode 100644
index 000000000..f42782840
--- /dev/null
+++ b/priv/repo/migrations/20170426154155_create_websub_client_subscription.exs
@@ -0,0 +1,15 @@
+defmodule Pleroma.Repo.Migrations.CreateWebsubClientSubscription do
+ use Ecto.Migration
+
+ def change do
+ create table(:websub_client_subscriptions) do
+ add :topic, :string
+ add :secret, :string
+ add :valid_until, :naive_datetime
+ add :state, :string
+ add :subscribers, :map
+
+ timestamps()
+ end
+ end
+end
diff --git a/priv/repo/migrations/20170427054757_add_user_and_hub.exs b/priv/repo/migrations/20170427054757_add_user_and_hub.exs
new file mode 100644
index 000000000..4f9a520bd
--- /dev/null
+++ b/priv/repo/migrations/20170427054757_add_user_and_hub.exs
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.AddUserAndHub do
+ use Ecto.Migration
+
+ def change do
+ alter table(:websub_client_subscriptions) do
+ add :hub, :string
+ add :user_id, references(:users)
+ end
+ end
+end
diff --git a/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs b/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs
new file mode 100644
index 000000000..21534adc7
--- /dev/null
+++ b/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs
@@ -0,0 +1,8 @@
+defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjects do
+ use Ecto.Migration
+
+ def change do
+ create index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index)
+ create index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index)
+ end
+end
diff --git a/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs b/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs
new file mode 100644
index 000000000..12eea1369
--- /dev/null
+++ b/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjectsPartTwo do
+ use Ecto.Migration
+
+ def change do
+ drop index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index)
+ drop index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index)
+ create unique_index(:objects, ["(data->>'id')"], name: :objects_unique_apid_index)
+ create unique_index(:activities, ["(data->>'id')"], name: :activities_unique_apid_index)
+ end
+end
diff --git a/priv/repo/migrations/20170502083023_add_local_field_to_activities.exs b/priv/repo/migrations/20170502083023_add_local_field_to_activities.exs
new file mode 100644
index 000000000..088d68f67
--- /dev/null
+++ b/priv/repo/migrations/20170502083023_add_local_field_to_activities.exs
@@ -0,0 +1,11 @@
+defmodule Pleroma.Repo.Migrations.AddLocalFieldToActivities do
+ use Ecto.Migration
+
+ def change do
+ alter table(:activities) do
+ add :local, :boolean, default: true
+ end
+
+ create index(:activities, [:local])
+ end
+end