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