-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
147 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/priv/repo/migrations/20240624123902_add_discord_client.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
defmodule Canary.Repo.Migrations.AddDiscordClient do | ||
@moduledoc """ | ||
Updates resources based on their most recent snapshots. | ||
This file was autogenerated with `mix ash_postgres.generate_migrations` | ||
""" | ||
|
||
use Ecto.Migration | ||
|
||
def up do | ||
alter table(:sources) do | ||
remove :last_fetched_at | ||
end | ||
|
||
alter table(:source_documents) do | ||
modify :content_hash, :binary, null: false | ||
modify :content, :text, null: false | ||
end | ||
|
||
alter table(:clients) do | ||
modify :web_public_key, :text, default: nil | ||
add :discord_server_id, :bigint | ||
end | ||
end | ||
|
||
def down do | ||
alter table(:clients) do | ||
remove :discord_server_id | ||
modify :web_public_key, :text, default: fragment("gen_random_uuid()") | ||
end | ||
|
||
alter table(:source_documents) do | ||
modify :content, :text, null: true | ||
modify :content_hash, :binary, null: true | ||
end | ||
|
||
alter table(:sources) do | ||
add :last_fetched_at, :utc_datetime_usec | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.