fix: add migration for new roles & isBasic -> basic

This commit is contained in:
vidvidvid
2022-01-21 16:00:41 +01:00
parent ec3258f4ac
commit b580fd5351
9 changed files with 24 additions and 18 deletions

View File

@@ -71,7 +71,7 @@
permission:
columns:
- description
- isBasic
- basic
- label
- role
filter: {}
@@ -79,7 +79,7 @@
permission:
columns:
- description
- isBasic
- basic
- label
- role
filter: {}

View File

@@ -0,0 +1 @@
alter table "public"."PlayerRole" rename column "basic" to "isBasic";

View File

@@ -0,0 +1 @@
alter table "public"."PlayerRole" rename column "isBasic" to "basic";

View File

@@ -0,0 +1,4 @@
INSERT INTO "public"."PlayerRole" (role, label, description, basic)
VALUES ('BRIDGEBUILDING', 'Bridgebuilding', 'All about fostering connections and enabling the flow of people & resources between different organizations.', false),
('VIDEOMAKING', 'Videomaking', 'As the name suggest - it''s about production of videos no matter the kind; educational, entertaining or both.', false),
('RAINMAKING', 'Rainmaking', 'Making sure value is recognized & project tokens get bought or liquidity added by long term holders.', false);

View File

@@ -40,7 +40,7 @@ export const SetupRoles: React.FC<SetupRolesProps> = ({
const toast = useToast();
const computeAvailableRoles = (playerRoles: string[]) =>
roleChoices.filter((r) => !playerRoles.includes(r.role) && r.isBasic);
roleChoices.filter((r) => !playerRoles.includes(r.role) && r.basic);
const [updateRolesResult, updateRoles] = useUpdatePlayerRolesMutation();
const [loading, setLoading] = useState(false);
@@ -51,7 +51,7 @@ export const SetupRoles: React.FC<SetupRolesProps> = ({
useMemo(() => {
if (roles.length > 0) {
setAvailableRoles(
roleChoices.filter((r) => !roles.includes(r.role) && r.isBasic),
roleChoices.filter((r) => !roles.includes(r.role) && r.basic),
);
}
}, [roles, roleChoices]);

View File

@@ -121,7 +121,7 @@ export const QuestFragment = gql`
}
quest_roles {
PlayerRole {
isBasic
basic
role
label
description
@@ -155,7 +155,7 @@ export const QuestWithCompletionFragment = gql`
}
quest_roles {
PlayerRole {
isBasic
basic
role
label
description

View File

@@ -9,7 +9,7 @@ export const GetPlayerTypes = gql`
role
label
description
isBasic
basic
}
}
`;

View File

@@ -11,7 +11,7 @@ export const getStaticProps = async () => {
return {
props: {
roleChoices: roleChoices.filter((r) => r.isBasic),
roleChoices: roleChoices.filter((r) => r.basic),
hideTopMenu: true,
},
};

View File

@@ -7288,8 +7288,8 @@ enum PlayerRank_update_column {
columns and relationships of "PlayerRole"
"""
type PlayerRole {
basic: Boolean
description: String
isBasic: Boolean
label: String!
role: String!
}
@@ -7335,8 +7335,8 @@ input PlayerRole_bool_exp {
_and: [PlayerRole_bool_exp]
_not: PlayerRole_bool_exp
_or: [PlayerRole_bool_exp]
basic: Boolean_comparison_exp
description: String_comparison_exp
isBasic: Boolean_comparison_exp
label: String_comparison_exp
role: String_comparison_exp
}
@@ -7355,8 +7355,8 @@ enum PlayerRole_constraint {
input type for inserting data into table "PlayerRole"
"""
input PlayerRole_insert_input {
basic: Boolean
description: String
isBasic: Boolean
label: String
role: String
}
@@ -7433,8 +7433,8 @@ input PlayerRole_on_conflict {
ordering options when selecting data from "PlayerRole"
"""
input PlayerRole_order_by {
basic: order_by
description: order_by
isBasic: order_by
label: order_by
role: order_by
}
@@ -7453,12 +7453,12 @@ enum PlayerRole_select_column {
"""
column name
"""
description
basic
"""
column name
"""
isBasic
description
"""
column name
@@ -7475,8 +7475,8 @@ enum PlayerRole_select_column {
input type for updating data in table "PlayerRole"
"""
input PlayerRole_set_input {
basic: Boolean
description: String
isBasic: Boolean
label: String
role: String
}
@@ -7488,12 +7488,12 @@ enum PlayerRole_update_column {
"""
column name
"""
description
basic
"""
column name
"""
isBasic
description
"""
column name
@@ -10378,7 +10378,7 @@ type quest_role {
"""
quest: quest!
quest_id: uuid!
rank: Int!
rank: Int
role: String!
}