-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add legacy boolean to clusters (#1350)
- Loading branch information
1 parent
bc76f23
commit 8b26d12
Showing
9 changed files
with
41 additions
and
4 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
13 changes: 13 additions & 0 deletions
13
apps/core/priv/repo/migrations/20240827164453_add_legacy_flag_clusters.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,13 @@ | ||
defmodule Core.Repo.Migrations.AddLegacyFlagClusters do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:clusters) do | ||
add :legacy, :boolean, default: true | ||
end | ||
|
||
alter table(:upgrade_queues) do | ||
add :legacy, :boolean, default: true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,17 @@ defmodule Core.Services.ClustersTest do | |
|
||
describe "#create_from_queue/1" do | ||
test "it can create a new cluster from an upgrade queue" do | ||
queue = insert(:upgrade_queue, domain: "console.plural.sh", git: "[email protected]/pluralsh/repo", provider: :aws) | ||
queue = insert(:upgrade_queue, | ||
domain: "console.plural.sh", | ||
git: "[email protected]/pluralsh/repo", | ||
provider: :aws, | ||
legacy: true | ||
) | ||
|
||
{:ok, cluster} = Clusters.create_from_queue(queue) | ||
|
||
assert cluster.name == queue.name | ||
assert cluster.legacy | ||
assert cluster.provider == queue.provider | ||
assert cluster.owner_id == queue.user_id | ||
assert cluster.account_id == queue.user.account_id | ||
|
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