aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/config/version.ex
blob: 2f66cc039a639fcc2d62f2775c4e45d5744c6e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.Config.Version do
  @moduledoc """
  IMPORTANT!!!
  Before modifying records in the database directly, please read "Config versioning" in `docs/development/config_versioning.md`.
  """

  use Ecto.Schema

  import Ecto.Query, only: [from: 2]

  schema "config_versions" do
    field(:backup, Pleroma.EctoType.Config.BinaryValue)
    field(:current, :boolean, default: true)

    timestamps()
  end

  def all do
    from(v in __MODULE__, order_by: [desc: v.id]) |> Pleroma.Repo.all()
  end
end