summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20210106183301_data_migration_create_populate_hashtags_table.exs
blob: cf3cf26a0f94fc9bcf7b518c814acd1cfbecb3b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
defmodule Pleroma.Repo.Migrations.DataMigrationCreatePopulateHashtagsTable do
  use Ecto.Migration

  def up do
    dt = NaiveDateTime.utc_now()

    execute(
      "INSERT INTO data_migrations(name, inserted_at, updated_at) " <>
        "VALUES ('populate_hashtags_table', '#{dt}', '#{dt}') ON CONFLICT DO NOTHING;"
    )
  end

  def down do
    execute("DELETE FROM data_migrations WHERE name = 'populate_hashtags_table';")
  end
end