eb510182960396a1955ad8bcacd6ccd82231d28c
[anni] / priv / repo / migrations / 20180429094642_create_lists.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.CreateLists do
6   use Ecto.Migration
7
8   def change do
9     create_if_not_exists table(:lists) do
10       add(:user_id, references(:users, on_delete: :delete_all))
11       add(:title, :string)
12       add(:following, {:array, :string})
13
14       timestamps()
15     end
16
17     create_if_not_exists(index(:lists, [:user_id]))
18   end
19 end