Make tests great again !

(Also use only one field for public/private key pem)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-06-14 17:25:55 +02:00
parent 32596c3624
commit ca36dd12e2
43 changed files with 498 additions and 656 deletions

View File

@@ -0,0 +1,15 @@
defmodule Eventos.Repo.Migrations.AddUUIDToComments do
use Ecto.Migration
def up do
alter table(:comments) do
add :uuid, :uuid
end
end
def down do
alter table(:comments) do
remove :uuid
end
end
end

View File

@@ -0,0 +1,15 @@
defmodule Eventos.Repo.Migrations.MakeSharedInboxUrlNullable do
use Ecto.Migration
def up do
alter table(:actors) do
modify :shared_inbox_url, :string, null: true, default: nil
end
end
def down do
alter table(:actors) do
add :shared_inbox_url, :string, null: false, default: ""
end
end
end

View File

@@ -0,0 +1,17 @@
defmodule Eventos.Repo.Migrations.FusionPublicPrivateKeyIntoKeysColumn do
use Ecto.Migration
def up do
rename table(:actors), :private_key, to: :keys
alter table(:actors) do
remove :public_key
end
end
def down do
alter table(:actors) do
rename :keys, to: :private_key
add :public_key, :text, null: true
end
end
end

View File

@@ -0,0 +1,23 @@
defmodule Eventos.Repo.Migrations.AddAttributedToFieldToEventsAndComments do
use Ecto.Migration
def up do
alter table(:events) do
add :attributed_to_id, references(:actors, on_delete: :nothing)
end
alter table(:comments) do
add :attributed_to_id, references(:actors, on_delete: :nothing)
end
end
def down do
alter table(:events) do
remove :attributed_to_id
end
alter table(:comments) do
remove :attributed_to_id
end
end
end