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