-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/ret ep update db+domain multi cluster (#367)
- [dashboard] set ret client to use the http port 4001 - [dashboard] added a migration to add 2 columns in hubs table, region and domain. - [dashboard] added the region and domain field in hubs class - [dashboard] send create hub instances req to orch with region, catch domain and region in orch's response, store them in db (hubs table) - [dashboard] ret_host_url to use orch provided multi-cluster domain and public api to check liveness - [dashboardclient] add domain and region field to hubT - [dashboardclient] use the newly provided domain value from dashboard's /api/v1/hubs for HubLink and HubCard
- Loading branch information
1 parent
304f7c0
commit 9f385f5
Showing
10 changed files
with
90 additions
and
17 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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
priv/repo/migrations/20230616000001_add_domain_and_region_columns_to_hubs.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,36 @@ | ||
defmodule Dash.Repo.Migrations.AddDomainAndRegionColumnsToHubs do | ||
use Ecto.Migration | ||
|
||
def up do | ||
execute(""" | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS( | ||
SELECT * FROM information_schema.columns | ||
WHERE table_name = 'hubs' AND column_name = 'domain' | ||
) THEN | ||
ALTER TABLE hubs ADD COLUMN domain VARCHAR(255); | ||
END IF; | ||
END | ||
$$; | ||
""") | ||
execute(""" | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS( | ||
SELECT * FROM information_schema.columns | ||
WHERE table_name = 'hubs' AND column_name = 'region' | ||
) THEN | ||
ALTER TABLE hubs ADD COLUMN region VARCHAR(255); | ||
END IF; | ||
END | ||
$$; | ||
""") | ||
end | ||
|
||
def down do | ||
execute("ALTER TABLE hubs DROP COLUMN IF EXISTS domain") | ||
execute("ALTER TABLE hubs DROP COLUMN IF EXISTS region") | ||
end | ||
|
||
end |