1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-23 00:14:48 +00:00
mobilizon/priv/repo/migrations/20190426093202_create_pictures.exs
Thomas Citharel f90089e1bf
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>
2019-05-24 17:29:51 +02:00

41 lines
798 B
Elixir

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