Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
  • Loading branch information
ThibaultFy committed Feb 6, 2023
1 parent e739ffa commit f7eeee1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/service/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestRegisterFunction(t *testing.T) {
StorageAddress: "ftp://127.0.0.1/test",
Checksum: "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2",
}
functionAdress := &asset.Addressable{
functionAddress := &asset.Addressable{
StorageAddress: "ftp://127.0.0.1/test",
Checksum: "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2",
}
Expand All @@ -42,7 +42,7 @@ func TestRegisterFunction(t *testing.T) {
function := &asset.NewFunction{
Key: "08680966-97ae-4573-8b2d-6c4db2b3c532",
Name: "Test function",
Function: functionAdress,
Function: functionAddress,
Description: description,
NewPermissions: newPerms,
}
Expand All @@ -55,7 +55,7 @@ func TestRegisterFunction(t *testing.T) {
storedFunction := &asset.Function{
Key: "08680966-97ae-4573-8b2d-6c4db2b3c532",
Name: "Test function",
Function: functionAdress,
Function: functionAddress,
Description: description,
Permissions: perms,
Owner: "owner",
Expand Down
2 changes: 1 addition & 1 deletion server/standalone/dbal/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (d *DBAL) AddFunction(function *asset.Function) error {

stmt := getStatementBuilder().
Insert("functions").
Columns("key", "channel", "name", "description", "functionAdress", "permissions", "owner", "creation_date", "metadata").
Columns("key", "channel", "name", "description", "functionAddress", "permissions", "owner", "creation_date", "metadata").
Values(function.Key, d.channel, function.Name, function.Description.StorageAddress, function.Function.StorageAddress, function.Permissions, function.Owner, function.CreationDate.AsTime(), function.Metadata)

err = d.exec(stmt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ALTER TABLE algos
RENAME CONSTRAINT algos_owner_channel_fkey TO functions_owner_channel_fkey;

ALTER TABLE algos
RENAME COLUMN algorithm TO functionAdress;
RENAME COLUMN algorithm TO functionAddress;

ALTER TABLE algos
RENAME TO functions;
Expand Down Expand Up @@ -34,7 +34,7 @@ SELECT key,
name,
description AS description_address,
desc_add.checksum AS description_checksum,
functionAdress AS function_address,
functionAddress AS function_address,
function_add.checksum AS function_checksum,
permissions,
owner,
Expand All @@ -43,7 +43,7 @@ SELECT key,
channel
FROM functions
JOIN addressables desc_add ON functions.description = desc_add.storage_address
JOIN addressables function_add ON functions.functionAdress = function_add.storage_address;
JOIN addressables function_add ON functions.functionAddress = function_add.storage_address;

INSERT INTO asset_kinds(kind)
VALUES ('ASSET_FUNCTION');
Expand Down

0 comments on commit f7eeee1

Please sign in to comment.