Refactor media upload

Use Upload Media logic from Pleroma

Backend changes for picture upload

Move AS <-> Model conversion to separate module

Front changes

Downgrade apollo-client: https://github.com/Akryum/vue-apollo/issues/577

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-05-22 14:12:11 +02:00
parent 9724bc8e9f
commit f90089e1bf
113 changed files with 4718 additions and 1328 deletions

View File

@@ -0,0 +1,41 @@
defmodule Mobilizon.Repo.Migrations.CreatePictures do
use Ecto.Migration
def up do
create table(:pictures) do
add(:file, :map)
timestamps()
end
alter table(:actors) do
remove(:avatar_url)
remove(:banner_url)
add(:avatar, :map)
add(:banner, :map)
end
alter table(:events) do
remove(:thumbnail)
remove(:large_image)
add(:picture_id, references(:pictures, on_delete: :delete_all))
end
end
def down do
alter table(:actors) do
add(:avatar_url, :string)
add(:banner_url, :string)
remove(:avatar)
remove(:banner)
end
alter table(:events) do
add(:large_image, :string)
add(:thumbnail, :string)
remove(:picture_id)
end
drop(table(:pictures))
end
end