2022-02-26 06:11:42 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 20:38:50 +00:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2022-02-26 06:11:42 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-10-17 12:26:59 +00:00
|
|
|
defmodule Pleroma.Repo.Migrations.CreateMarkers do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create_if_not_exists table(:markers) do
|
|
|
|
add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
|
|
|
|
add(:timeline, :string, default: "", null: false)
|
|
|
|
add(:last_read_id, :string, default: "", null: false)
|
|
|
|
add(:lock_version, :integer, default: 0, null: false)
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
create_if_not_exists(unique_index(:markers, [:user_id, :timeline]))
|
|
|
|
end
|
|
|
|
end
|