move to 2.5.5
[anni] / priv / repo / migrations / 20210106183301_data_migration_create_populate_hashtags_table.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.DataMigrationCreatePopulateHashtagsTable do
6   use Ecto.Migration
7
8   def up do
9     dt = NaiveDateTime.utc_now()
10
11     execute(
12       "INSERT INTO data_migrations(name, inserted_at, updated_at) " <>
13         "VALUES ('populate_hashtags_table', '#{dt}', '#{dt}') ON CONFLICT DO NOTHING;"
14     )
15   end
16
17   def down do
18     execute("DELETE FROM data_migrations WHERE name = 'populate_hashtags_table';")
19   end
20 end