logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20210106183301_data_migration_create_populate_hashtags_table.exs (596B)


  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. defmodule Pleroma.Repo.Migrations.DataMigrationCreatePopulateHashtagsTable do
  5. use Ecto.Migration
  6. def up do
  7. dt = NaiveDateTime.utc_now()
  8. execute(
  9. "INSERT INTO data_migrations(name, inserted_at, updated_at) " <>
  10. "VALUES ('populate_hashtags_table', '#{dt}', '#{dt}') ON CONFLICT DO NOTHING;"
  11. )
  12. end
  13. def down do
  14. execute("DELETE FROM data_migrations WHERE name = 'populate_hashtags_table';")
  15. end
  16. end