Skip to content

Commit

Permalink
Make global_type string in avinya_types required
Browse files Browse the repository at this point in the history
- Cosmetic updates
  • Loading branch information
rukmal committed Oct 6, 2022
1 parent 1e09406 commit 96d3ef0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/avinya_data.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public distinct service class AvinyaTypeData {
return self.avinya_type.active;
}

resource function get global_type() returns string? {
resource function get global_type() returns string {
return self.avinya_type.global_type;
}

Expand Down
2 changes: 1 addition & 1 deletion api/organization_data.bal
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public distinct service class OrganizationData {
}

resource function get people() returns PersonData[]|error? {
// Get list of child organizations
// Get list of people in the organization
stream<Person, error?> people = db_client->query(
`SELECT *
FROM avinya_db.person
Expand Down
2 changes: 1 addition & 1 deletion api/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public type AvinyaType record{|
readonly string record_type = "avinya_type";
int id?;
boolean active;
string? global_type;
string global_type;
string? name;
string? foundation_type;
string? focus;
Expand Down
8 changes: 7 additions & 1 deletion db/schema/2-avinya_types.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ USE avinya_db;
CREATE TABLE IF NOT EXISTS avinya_type (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
active BOOLEAN NOT NULL,
global_type ENUM("Employee", "Customer", "Volunteer", "Applicant", "Organization", "Team") NOT NULL,
global_type ENUM(
"Employee",
"Customer",
"Volunteer",
"Applicant",
"Team"
) NOT NULL,
name VARCHAR(255),
foundation_type ENUM(
"Executive",
Expand Down

0 comments on commit 96d3ef0

Please sign in to comment.