Skip to content

Commit 08f365e

Browse files
rename last_modified_by to last_updated_by
1 parent 59845a2 commit 08f365e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

ee/ephemeral_environments/lib/ephemeral_environments/repo/ephemeral_environment_type.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule EphemeralEnvironments.Repo.EphemeralEnvironmentType do
1010
field(:name, :string)
1111
field(:description, :string)
1212
field(:created_by, :binary_id)
13-
field(:last_modified_by, :binary_id)
13+
field(:last_updated_by, :binary_id)
1414
field(:state, Ecto.Enum, values: [:draft, :ready, :cordoned, :deleted])
1515
field(:max_number_of_instances, :integer)
1616

@@ -24,14 +24,14 @@ defmodule EphemeralEnvironments.Repo.EphemeralEnvironmentType do
2424
:name,
2525
:description,
2626
:created_by,
27-
:last_modified_by,
27+
:last_updated_by,
2828
:state,
2929
:max_number_of_instances
3030
])
31-
|> validate_required([:org_id, :name, :created_by, :last_modified_by, :state])
31+
|> validate_required([:org_id, :name, :created_by, :last_updated_by, :state])
3232
|> validate_uuid(:org_id)
3333
|> validate_uuid(:created_by)
34-
|> validate_uuid(:last_modified_by)
34+
|> validate_uuid(:last_updated_by)
3535
|> validate_length(:name, min: 1, max: 255)
3636
|> validate_length(:description, max: 1000)
3737
|> validate_number(:max_number_of_instances, greater_than: 0)

ee/ephemeral_environments/lib/ephemeral_environments/service/ephemeral_environment_type.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defmodule EphemeralEnvironments.Service.EphemeralEnvironmentType do
1919
- {:error, String.t()} on validation failure
2020
"""
2121
def create(attrs) do
22-
attrs = Map.put(attrs, :last_modified_by, attrs[:created_by])
22+
attrs = Map.put(attrs, :last_updated_by, attrs[:created_by])
2323
attrs = Map.put_new(attrs, :state, :draft)
2424

2525
%Schema{}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
defmodule EphemeralEnvironments.Repo.Migrations.RenameLastModifiedByToLastUpdatedBy do
2+
use Ecto.Migration
3+
4+
def change do
5+
rename table(:ephemeral_environment_types), :last_modified_by, to: :last_updated_by
6+
end
7+
end

0 commit comments

Comments
 (0)