1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.ChangeFollowingRelationshipsStateToInteger do
8 @alter_following_relationship_state "ALTER TABLE following_relationships ALTER COLUMN state"
12 #{@alter_following_relationship_state} TYPE integer USING
14 WHEN state = 'pending' THEN 1
15 WHEN state = 'accept' THEN 2
16 WHEN state = 'reject' THEN 3
24 #{@alter_following_relationship_state} TYPE varchar(255) USING
26 WHEN state = 1 THEN 'pending'
27 WHEN state = 2 THEN 'accept'
28 WHEN state = 3 THEN 'reject'