Skip to content

Commit

Permalink
Remove update of unique key column from repository Create method of p…
Browse files Browse the repository at this point in the history
…ermission, role, feature, and pricing-tier resources (warrant-dev#70)
  • Loading branch information
kkajla12 authored Apr 7, 2023
1 parent 5655403 commit e470584
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 16 deletions.
2 changes: 0 additions & 2 deletions pkg/authz/feature/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
) VALUES (?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
objectId = ?,
featureId = ?,
name = ?,
description = ?,
createdAt = CURRENT_TIMESTAMP(6),
Expand All @@ -45,7 +44,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetFeatureId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/feature/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
) VALUES (?, ?, ?, ?)
ON CONFLICT (feature_id) DO UPDATE SET
object_id = ?,
feature_id = ?,
name = ?,
description = ?,
created_at = CURRENT_TIMESTAMP(6),
Expand All @@ -49,7 +48,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetFeatureId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/permission/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
) VALUES (?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
objectId = ?,
permissionId = ?,
name = ?,
description = ?,
createdAt = CURRENT_TIMESTAMP(6),
Expand All @@ -45,7 +44,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetPermissionId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/permission/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
) VALUES (?, ?, ?, ?)
ON CONFLICT (permission_id) DO UPDATE SET
object_id = ?,
permission_id = ?,
name = ?,
description = ?,
created_at = CURRENT_TIMESTAMP(6),
Expand All @@ -49,7 +48,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetPermissionId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/pricingtier/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
) VALUES (?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
objectId = ?,
pricingTierId = ?,
name = ?,
description = ?,
createdAt = CURRENT_TIMESTAMP(6),
Expand All @@ -45,7 +44,6 @@ func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, err
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetPricingTierId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/pricingtier/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
) VALUES (?, ?, ?, ?)
ON CONFLICT (pricing_tier_id) DO UPDATE SET
object_id = ?,
pricing_tier_id = ?,
name = ?,
description = ?,
created_at = CURRENT_TIMESTAMP(6),
Expand All @@ -49,7 +48,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetPricingTierId(),
model.GetName(),
model.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/role/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (repo MySQLRepository) Create(ctx context.Context, role Model) (int64, erro
) VALUES (?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
objectId = ?,
roleId = ?,
name = ?,
description = ?,
createdAt = CURRENT_TIMESTAMP(6),
Expand All @@ -45,7 +44,6 @@ func (repo MySQLRepository) Create(ctx context.Context, role Model) (int64, erro
role.GetName(),
role.GetDescription(),
role.GetObjectId(),
role.GetRoleId(),
role.GetName(),
role.GetDescription(),
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/authz/role/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
) VALUES (?, ?, ?, ?)
ON CONFLICT (role_id) DO UPDATE SET
object_id = ?,
role_id = ?,
name = ?,
description = ?,
created_at = CURRENT_TIMESTAMP(6),
Expand All @@ -49,7 +48,6 @@ func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64,
model.GetName(),
model.GetDescription(),
model.GetObjectId(),
model.GetRoleId(),
model.GetName(),
model.GetDescription(),
)
Expand Down

0 comments on commit e470584

Please sign in to comment.