From 15714801bf7b39821b33cc29322c78a899bccfda Mon Sep 17 00:00:00 2001 From: Jan Hendrik Scheufen Date: Thu, 3 Oct 2024 12:43:35 -0400 Subject: [PATCH] Added female options to titles enum in DB and constants.ts Signed-off-by: Jan Hendrik Scheufen --- packages/app/config/constants.ts | 8 +- .../migrations/0009_narrow_pepper_potts.sql | 7 + .../app/db/migrations/meta/0009_snapshot.json | 399 ++++++++++++++++++ packages/app/db/migrations/meta/_journal.json | 7 + 4 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 packages/app/db/migrations/0009_narrow_pepper_potts.sql create mode 100644 packages/app/db/migrations/meta/0009_snapshot.json diff --git a/packages/app/config/constants.ts b/packages/app/config/constants.ts index 5144e81..8c197db 100755 --- a/packages/app/config/constants.ts +++ b/packages/app/config/constants.ts @@ -2,13 +2,19 @@ import { LinkType } from '@/db/schema'; export const titles = [ 'mestre', + 'mestra', 'contra-mestre', + 'contra-mestra', 'mestrando', + 'mestranda', 'professor', + 'professora', 'instrutor', + 'instrutora', 'monitor', - 'aluno-graduado', + 'monitora', 'aluno', + 'aluna', 'iniciante', ] as const; diff --git a/packages/app/db/migrations/0009_narrow_pepper_potts.sql b/packages/app/db/migrations/0009_narrow_pepper_potts.sql new file mode 100644 index 0000000..4049879 --- /dev/null +++ b/packages/app/db/migrations/0009_narrow_pepper_potts.sql @@ -0,0 +1,7 @@ +ALTER TYPE "title" ADD VALUE 'mestra';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'contra-mestra';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'mestranda';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'professora';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'instrutora';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'monitora';--> statement-breakpoint +ALTER TYPE "title" ADD VALUE 'aluna'; \ No newline at end of file diff --git a/packages/app/db/migrations/meta/0009_snapshot.json b/packages/app/db/migrations/meta/0009_snapshot.json new file mode 100644 index 0000000..260f9a3 --- /dev/null +++ b/packages/app/db/migrations/meta/0009_snapshot.json @@ -0,0 +1,399 @@ +{ + "id": "d369225e-22ca-4d5a-a49e-f966e00cfb31", + "prevId": "afcd7c98-c077-4f0b-bcde-1faea496dd40", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.group_admins": { + "name": "group_admins", + "schema": "", + "columns": { + "group_id": { + "name": "group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "group_admins_group_id_groups_id_fk": { + "name": "group_admins_group_id_groups_id_fk", + "tableFrom": "group_admins", + "tableTo": "groups", + "columnsFrom": [ + "group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "group_admins_user_id_users_id_fk": { + "name": "group_admins_user_id_users_id_fk", + "tableFrom": "group_admins", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "group_admins_group_id_user_id_pk": { + "name": "group_admins_group_id_user_id_pk", + "columns": [ + "group_id", + "user_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.groups": { + "name": "groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo": { + "name": "logo", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "banner": { + "name": "banner", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "leader_id": { + "name": "leader_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "founder": { + "name": "founder", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "city": { + "name": "city", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "country": { + "name": "country", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "links": { + "name": "links", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + } + }, + "indexes": { + "name_idx": { + "name": "name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "groups_leader_id_users_id_fk": { + "name": "groups_leader_id_users_id_fk", + "tableFrom": "groups", + "tableTo": "users", + "columnsFrom": [ + "leader_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "nickname": { + "name": "nickname", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "title", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "avatar": { + "name": "avatar", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "group_id": { + "name": "group_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "phone": { + "name": "phone", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "wallet_address": { + "name": "wallet_address", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_global_admin": { + "name": "is_global_admin", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "links": { + "name": "links", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + } + }, + "indexes": { + "nickname_idx": { + "name": "nickname_idx", + "columns": [ + { + "expression": "nickname", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "title_idx": { + "name": "title_idx", + "columns": [ + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "group_idx": { + "name": "group_idx", + "columns": [ + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "email_idx": { + "name": "email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "users_group_id_groups_id_fk": { + "name": "users_group_id_groups_id_fk", + "tableFrom": "users", + "tableTo": "groups", + "columnsFrom": [ + "group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.link_type": { + "name": "link_type", + "schema": "public", + "values": [ + "twitter", + "facebook", + "instagram", + "linkedin" + ] + }, + "public.title": { + "name": "title", + "schema": "public", + "values": [ + "mestre", + "mestra", + "contra-mestre", + "contra-mestra", + "mestrando", + "mestranda", + "professor", + "professora", + "instrutor", + "instrutora", + "monitor", + "monitora", + "aluno", + "aluna", + "iniciante" + ] + } + }, + "schemas": {}, + "sequences": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/app/db/migrations/meta/_journal.json b/packages/app/db/migrations/meta/_journal.json index 2120b73..3763a4b 100755 --- a/packages/app/db/migrations/meta/_journal.json +++ b/packages/app/db/migrations/meta/_journal.json @@ -64,6 +64,13 @@ "when": 1727054115714, "tag": "0008_nice_franklin_storm", "breakpoints": true + }, + { + "idx": 9, + "version": "7", + "when": 1727973704124, + "tag": "0009_narrow_pepper_potts", + "breakpoints": true } ] } \ No newline at end of file