2022-08-07 12:41:24 -06:00
|
|
|
defmodule Pleroma.Repo.Migrations.DataMigrationDeleteContextObjects do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
require Logger
|
|
|
|
|
2022-08-14 17:15:23 -06:00
|
|
|
def up do
|
|
|
|
dt = NaiveDateTime.utc_now()
|
2022-08-07 12:41:24 -06:00
|
|
|
|
2022-08-14 17:15:23 -06:00
|
|
|
execute(
|
|
|
|
"INSERT INTO data_migrations(name, inserted_at, updated_at) " <>
|
|
|
|
"VALUES ('delete_context_objects', '#{dt}', '#{dt}') ON CONFLICT DO NOTHING;"
|
2022-08-07 12:41:24 -06:00
|
|
|
)
|
2022-08-14 17:15:23 -06:00
|
|
|
end
|
2022-08-07 12:41:24 -06:00
|
|
|
|
2022-08-14 17:15:23 -06:00
|
|
|
def down do
|
|
|
|
execute("DELETE FROM data_migrations WHERE name = 'delete_context_objects';")
|
2022-08-07 12:41:24 -06:00
|
|
|
end
|
|
|
|
end
|