Add admin interface to manage instances subscriptions
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.AddTimestampsToFollowers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:followers) do
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.DeleteEventCascadeToComments do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
drop_if_exists(constraint(:comments, "comments_event_id_fkey"))
|
||||
|
||||
alter table(:comments) do
|
||||
modify(:event_id, references(:events, on_delete: :delete_all))
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
drop_if_exists(constraint(:comments, "comments_event_id_fkey"))
|
||||
|
||||
alter table(:comments) do
|
||||
modify(:event_id, references(:events, on_delete: :nothing))
|
||||
end
|
||||
end
|
||||
end
|
||||
23
priv/repo/migrations/20191206144028_create_shares.exs
Normal file
23
priv/repo/migrations/20191206144028_create_shares.exs
Normal file
@@ -0,0 +1,23 @@
|
||||
defmodule Mobilizon.Repo.Migrations.CreateShares do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
create table(:shares) do
|
||||
add(:uri, :string, null: false)
|
||||
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
|
||||
add(:owner_actor_id, references(:actors, on_delete: :delete_all), null: false)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create_if_not_exists(
|
||||
index(:shares, [:uri, :actor_id], unique: true, name: :shares_uri_actor_id_index)
|
||||
)
|
||||
end
|
||||
|
||||
def down do
|
||||
drop_if_exists(index(:shares, [:uri, :actor_id]))
|
||||
|
||||
drop_if_exists(table(:shares))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user