diff --git a/drizzle/migrations/0019_married_starfox.sql b/drizzle/migrations/0019_married_starfox.sql new file mode 100644 index 00000000..e1fb9361 --- /dev/null +++ b/drizzle/migrations/0019_married_starfox.sql @@ -0,0 +1 @@ +ALTER TABLE "tickets" ADD COLUMN "max_tickets_per_user" integer; \ No newline at end of file diff --git a/drizzle/migrations/meta/0019_snapshot.json b/drizzle/migrations/meta/0019_snapshot.json new file mode 100644 index 00000000..10425dbc --- /dev/null +++ b/drizzle/migrations/meta/0019_snapshot.json @@ -0,0 +1,2624 @@ +{ + "id": "dcedf1be-2b76-42a8-95da-1702fb9aeb42", + "prevId": "6abfe288-5e27-4d48-8c63-d18b364d4060", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.allowed_currencies": { + "name": "allowed_currencies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payment_methods": { + "name": "payment_methods", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "allowed_currencies_currency_unique": { + "name": "allowed_currencies_currency_unique", + "nullsNotDistinct": false, + "columns": ["currency"] + } + } + }, + "public.communities": { + "name": "communities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo_image_sanity_ref": { + "name": "logo_image_sanity_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banner_image_sanity_ref": { + "name": "banner_image_sanity_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_success_redirect_url": { + "name": "payment_success_redirect_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_cancel_redirect_url": { + "name": "payment_cancel_redirect_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'inactive'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "communities_slug_unique": { + "name": "communities_slug_unique", + "nullsNotDistinct": false, + "columns": ["slug"] + } + } + }, + "public.companies": { + "name": "companies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "logo": { + "name": "logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "website": { + "name": "website", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'draft'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.confirmation_token": { + "name": "confirmation_token", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source_id": { + "name": "source_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'pending'" + }, + "valid_until": { + "name": "valid_until", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "confirmation_date": { + "name": "confirmation_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "confirmation_token_user_id_users_id_fk": { + "name": "confirmation_token_user_id_users_id_fk", + "tableFrom": "confirmation_token", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "confirmation_token_token_unique": { + "name": "confirmation_token_token_unique", + "nullsNotDistinct": false, + "columns": ["token"] + } + } + }, + "public.events": { + "name": "events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'inactive'" + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'unlisted'" + }, + "start_date_time": { + "name": "start_date_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_date_time": { + "name": "end_date_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "timezone": { + "name": "timezone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geo_latitude": { + "name": "geo_latitude", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geo_longitude": { + "name": "geo_longitude", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "geo_address_json": { + "name": "geo_address_json", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "address_descriptive_name": { + "name": "address_descriptive_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meeting_url": { + "name": "meeting_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sanity_event_id": { + "name": "sanity_event_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banner_image_sanity_ref": { + "name": "banner_image_sanity_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "events_name_unique": { + "name": "events_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + } + }, + "public.events_communities": { + "name": "events_communities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "community_id": { + "name": "community_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "payment_success_redirect_url": { + "name": "payment_success_redirect_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_cancel_redirect_url": { + "name": "payment_cancel_redirect_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "events_communities_event_id_events_id_fk": { + "name": "events_communities_event_id_events_id_fk", + "tableFrom": "events_communities", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "events_communities_community_id_communities_id_fk": { + "name": "events_communities_community_id_communities_id_fk", + "tableFrom": "events_communities", + "tableTo": "communities", + "columnsFrom": ["community_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "events_communities_event_id_community_id_pk": { + "name": "events_communities_event_id_community_id_pk", + "columns": ["event_id", "community_id"] + } + }, + "uniqueConstraints": { + "events_communities_id_unique": { + "name": "events_communities_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.events_tags": { + "name": "events_tags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tag_id": { + "name": "tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "events_tags_event_id_events_id_fk": { + "name": "events_tags_event_id_events_id_fk", + "tableFrom": "events_tags", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "events_tags_tag_id_tags_id_fk": { + "name": "events_tags_tag_id_tags_id_fk", + "tableFrom": "events_tags", + "tableTo": "tags", + "columnsFrom": ["tag_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "events_tags_event_id_tag_id_pk": { + "name": "events_tags_event_id_tag_id_pk", + "columns": ["event_id", "tag_id"] + } + }, + "uniqueConstraints": { + "events_tags_id_unique": { + "name": "events_tags_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.events_users": { + "name": "events_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'member'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "events_users_event_id_events_id_fk": { + "name": "events_users_event_id_events_id_fk", + "tableFrom": "events_users", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "events_users_user_id_users_id_fk": { + "name": "events_users_user_id_users_id_fk", + "tableFrom": "events_users", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.payments_logs": { + "name": "payments_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "external_product_reference": { + "name": "external_product_reference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "platform": { + "name": "platform", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_amount": { + "name": "transaction_amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "external_creation_date": { + "name": "external_creation_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": false + }, + "currency_id": { + "name": "currency_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "original_response_blob": { + "name": "original_response_blob", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "payments_logs_external_id_platform_unique": { + "name": "payments_logs_external_id_platform_unique", + "nullsNotDistinct": false, + "columns": ["external_id", "platform"] + } + } + }, + "public.prices": { + "name": "prices", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "price": { + "name": "price", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "currency_id": { + "name": "currency_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "prices_currency_id_allowed_currencies_id_fk": { + "name": "prices_currency_id_allowed_currencies_id_fk", + "tableFrom": "prices", + "tableTo": "allowed_currencies", + "columnsFrom": ["currency_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.purchase_orders": { + "name": "purchase_orders", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idempotency_uuid_key": { + "name": "idempotency_uuid_key", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "payment_platform": { + "name": "payment_platform", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_price": { + "name": "total_price", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'open'" + }, + "currency_id": { + "name": "currency_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payment_platform_payment_link": { + "name": "payment_platform_payment_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_platform_expiration_date": { + "name": "payment_platform_expiration_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "payment_platform_reference_id": { + "name": "payment_platform_reference_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_platform_status": { + "name": "payment_platform_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_platform_metadata": { + "name": "payment_platform_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "purchase_order_payment_status": { + "name": "purchase_order_payment_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'unpaid'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "purchase_orders_user_id_users_id_fk": { + "name": "purchase_orders_user_id_users_id_fk", + "tableFrom": "purchase_orders", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "purchase_orders_currency_id_allowed_currencies_id_fk": { + "name": "purchase_orders_currency_id_allowed_currencies_id_fk", + "tableFrom": "purchase_orders", + "tableTo": "allowed_currencies", + "columnsFrom": ["currency_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "purchase_orders_idempotency_uuid_key_unique": { + "name": "purchase_orders_idempotency_uuid_key_unique", + "nullsNotDistinct": false, + "columns": ["idempotency_uuid_key"] + } + } + }, + "public.salaries": { + "name": "salaries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "company_id": { + "name": "company_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "currency_code": { + "name": "currency_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "work_seniority_and_role_id": { + "name": "work_seniority_and_role_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "work_email_id": { + "name": "work_email_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "years_of_experience": { + "name": "years_of_experience", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gender_other_text": { + "name": "gender_other_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "country_code": { + "name": "country_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type_of_employment": { + "name": "type_of_employment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "work_metodology": { + "name": "work_metodology", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "salaries_user_id_users_id_fk": { + "name": "salaries_user_id_users_id_fk", + "tableFrom": "salaries", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "salaries_company_id_companies_id_fk": { + "name": "salaries_company_id_companies_id_fk", + "tableFrom": "salaries", + "tableTo": "companies", + "columnsFrom": ["company_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "salaries_work_seniority_and_role_id_work_seniority_and_role_id_fk": { + "name": "salaries_work_seniority_and_role_id_work_seniority_and_role_id_fk", + "tableFrom": "salaries", + "tableTo": "work_seniority_and_role", + "columnsFrom": ["work_seniority_and_role_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "salaries_work_email_id_work_email_id_fk": { + "name": "salaries_work_email_id_work_email_id_fk", + "tableFrom": "salaries", + "tableTo": "work_email", + "columnsFrom": ["work_email_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.schedule": { + "name": "schedule", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start_at": { + "name": "start_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "end_at": { + "name": "end_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "schedule_event_id_events_id_fk": { + "name": "schedule_event_id_events_id_fk", + "tableFrom": "schedule", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "schedule_id_unique": { + "name": "schedule_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.sessions": { + "name": "sessions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "schedule_id": { + "name": "schedule_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start_at": { + "name": "start_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "end_at": { + "name": "end_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "sessions_schedule_id_schedule_id_fk": { + "name": "sessions_schedule_id_schedule_id_fk", + "tableFrom": "sessions", + "tableTo": "schedule", + "columnsFrom": ["schedule_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "sessions_id_unique": { + "name": "sessions_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.session_to_speakers": { + "name": "session_to_speakers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "session_id": { + "name": "session_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "speaker_id": { + "name": "speaker_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_to_speakers_session_id_sessions_id_fk": { + "name": "session_to_speakers_session_id_sessions_id_fk", + "tableFrom": "session_to_speakers", + "tableTo": "sessions", + "columnsFrom": ["session_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "session_to_speakers_speaker_id_speakers_id_fk": { + "name": "session_to_speakers_speaker_id_speakers_id_fk", + "tableFrom": "session_to_speakers", + "tableTo": "speakers", + "columnsFrom": ["speaker_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_to_speakers_id_unique": { + "name": "session_to_speakers_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.speakers": { + "name": "speakers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar": { + "name": "avatar", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "company": { + "name": "company", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "social_links": { + "name": "social_links", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "speakers_event_id_events_id_fk": { + "name": "speakers_event_id_events_id_fk", + "tableFrom": "speakers", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "speakers_id_unique": { + "name": "speakers_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.tags": { + "name": "tags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tags_name_unique": { + "name": "tags_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + } + }, + "public.tags_communities": { + "name": "tags_communities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tag_id": { + "name": "tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "community_id": { + "name": "community_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "tags_communities_tag_id_tags_id_fk": { + "name": "tags_communities_tag_id_tags_id_fk", + "tableFrom": "tags_communities", + "tableTo": "tags", + "columnsFrom": ["tag_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tags_communities_community_id_communities_id_fk": { + "name": "tags_communities_community_id_communities_id_fk", + "tableFrom": "tags_communities", + "tableTo": "communities", + "columnsFrom": ["community_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "tags_communities_tag_id_community_id_pk": { + "name": "tags_communities_tag_id_community_id_pk", + "columns": ["tag_id", "community_id"] + } + }, + "uniqueConstraints": { + "tags_communities_id_unique": { + "name": "tags_communities_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.teams": { + "name": "teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "limit": { + "name": "limit", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "team_status": { + "name": "team_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'waiting_resolution'" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "teams_event_id_events_id_fk": { + "name": "teams_event_id_events_id_fk", + "tableFrom": "teams", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.tickets_prices": { + "name": "tickets_prices", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "ticket_id": { + "name": "ticket_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "price_id": { + "name": "price_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "tickets_prices_ticket_id_tickets_id_fk": { + "name": "tickets_prices_ticket_id_tickets_id_fk", + "tableFrom": "tickets_prices", + "tableTo": "tickets", + "columnsFrom": ["ticket_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tickets_prices_price_id_prices_id_fk": { + "name": "tickets_prices_price_id_prices_id_fk", + "tableFrom": "tickets_prices", + "tableTo": "prices", + "columnsFrom": ["price_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.tickets": { + "name": "tickets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'inactive'" + }, + "tags": { + "name": "tags", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "external_link": { + "name": "external_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "max_tickets_per_user": { + "name": "max_tickets_per_user", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "image_link": { + "name": "image_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'unlisted'" + }, + "start_date_time": { + "name": "start_date_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_date_time": { + "name": "end_date_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "requires_approval": { + "name": "requires_approval", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "quantity": { + "name": "quantity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_unlimited": { + "name": "is_unlimited", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_free": { + "name": "is_free", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "stripe_product_id": { + "name": "stripe_product_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mercado_pago_product_id": { + "name": "mercado_pago_product_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "tickets_event_id_events_id_fk": { + "name": "tickets_event_id_events_id_fk", + "tableFrom": "tickets", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tickets_name_unique": { + "name": "tickets_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + } + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "externalId": { + "name": "externalId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lastName": { + "name": "lastName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "''" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'inactive'" + }, + "gender_other_text": { + "name": "gender_other_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "isSuperAdmin": { + "name": "isSuperAdmin", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "emailVerified": { + "name": "emailVerified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "imageUrl": { + "name": "imageUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "publicMetadata": { + "name": "publicMetadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_unique": { + "name": "users_email_unique", + "nullsNotDistinct": false, + "columns": ["email"] + }, + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": ["username"] + } + } + }, + "public.users_communities": { + "name": "users_communities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "community_id": { + "name": "community_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'member'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "users_communities_user_id_users_id_fk": { + "name": "users_communities_user_id_users_id_fk", + "tableFrom": "users_communities", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "users_communities_community_id_communities_id_fk": { + "name": "users_communities_community_id_communities_id_fk", + "tableFrom": "users_communities", + "tableTo": "communities", + "columnsFrom": ["community_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.users_tags": { + "name": "users_tags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "tag_id": { + "name": "tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "users_tags_tag_id_tags_id_fk": { + "name": "users_tags_tag_id_tags_id_fk", + "tableFrom": "users_tags", + "tableTo": "tags", + "columnsFrom": ["tag_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "users_tags_user_id_users_id_fk": { + "name": "users_tags_user_id_users_id_fk", + "tableFrom": "users_tags", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "users_tags_tag_id_user_id_pk": { + "name": "users_tags_tag_id_user_id_pk", + "columns": ["tag_id", "user_id"] + } + }, + "uniqueConstraints": { + "users_tags_id_unique": { + "name": "users_tags_id_unique", + "nullsNotDistinct": false, + "columns": ["id"] + } + } + }, + "public.user_teams": { + "name": "user_teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'leader'" + }, + "discipline": { + "name": "discipline", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_participation_status": { + "name": "user_participation_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'waiting_resolution'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_teams_user_id_users_id_fk": { + "name": "user_teams_user_id_users_id_fk", + "tableFrom": "user_teams", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_teams_team_id_teams_id_fk": { + "name": "user_teams_team_id_teams_id_fk", + "tableFrom": "user_teams", + "tableTo": "teams", + "columnsFrom": ["team_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.user_tickets": { + "name": "user_tickets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ticket_template_id": { + "name": "ticket_template_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "purchase_order_id": { + "name": "purchase_order_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "approval_status": { + "name": "approval_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "redemption_status": { + "name": "redemption_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_tickets_user_id_users_id_fk": { + "name": "user_tickets_user_id_users_id_fk", + "tableFrom": "user_tickets", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_tickets_ticket_template_id_tickets_id_fk": { + "name": "user_tickets_ticket_template_id_tickets_id_fk", + "tableFrom": "user_tickets", + "tableTo": "tickets", + "columnsFrom": ["ticket_template_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_tickets_purchase_order_id_purchase_orders_id_fk": { + "name": "user_tickets_purchase_order_id_purchase_orders_id_fk", + "tableFrom": "user_tickets", + "tableTo": "purchase_orders", + "columnsFrom": ["purchase_order_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.work_email": { + "name": "work_email", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "work_email": { + "name": "work_email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "confirmation_token_id": { + "name": "confirmation_token_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'pending'" + }, + "confirmation_date": { + "name": "confirmation_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "company_id": { + "name": "company_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "work_email_user_id_users_id_fk": { + "name": "work_email_user_id_users_id_fk", + "tableFrom": "work_email", + "tableTo": "users", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "work_email_confirmation_token_id_confirmation_token_id_fk": { + "name": "work_email_confirmation_token_id_confirmation_token_id_fk", + "tableFrom": "work_email", + "tableTo": "confirmation_token", + "columnsFrom": ["confirmation_token_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "work_email_company_id_companies_id_fk": { + "name": "work_email_company_id_companies_id_fk", + "tableFrom": "work_email", + "tableTo": "companies", + "columnsFrom": ["company_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.work_role": { + "name": "work_role", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.work_seniority": { + "name": "work_seniority", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.work_seniority_and_role": { + "name": "work_seniority_and_role", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "work_role_id": { + "name": "work_role_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "work_seniority_id": { + "name": "work_seniority_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "work_seniority_and_role_work_role_id_work_role_id_fk": { + "name": "work_seniority_and_role_work_role_id_work_role_id_fk", + "tableFrom": "work_seniority_and_role", + "tableTo": "work_role", + "columnsFrom": ["work_role_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "work_seniority_and_role_work_seniority_id_work_seniority_id_fk": { + "name": "work_seniority_and_role_work_seniority_id_work_seniority_id_fk", + "tableFrom": "work_seniority_and_role", + "tableTo": "work_seniority", + "columnsFrom": ["work_seniority_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/drizzle/migrations/meta/_journal.json b/drizzle/migrations/meta/_journal.json index d3ef13cc..4a061a99 100644 --- a/drizzle/migrations/meta/_journal.json +++ b/drizzle/migrations/meta/_journal.json @@ -134,6 +134,13 @@ "when": 1722914707843, "tag": "0018_friendly_killraven", "breakpoints": true + }, + { + "idx": 19, + "version": "7", + "when": 1722983703830, + "tag": "0019_married_starfox", + "breakpoints": true } ] } diff --git a/src/datasources/db/tickets.ts b/src/datasources/db/tickets.ts index 6ef702d6..a1c7df2a 100644 --- a/src/datasources/db/tickets.ts +++ b/src/datasources/db/tickets.ts @@ -31,6 +31,7 @@ export const ticketsSchema = pgTable("tickets", { .notNull() .default(sql`ARRAY[]::text[]`), externalLink: text("external_link"), + maxTicketsPerUser: integer("max_tickets_per_user"), imageLink: text("image_link"), visibility: text("visibility", { enum: ticketVisibilityEnum, @@ -76,6 +77,11 @@ export const updateTicketSchema = insertTicketSchema endDateTime: true, quantity: true, requiresApproval: true, + maxTicketsPerUser: true, + imageLink: true, + externalLink: true, + isFree: true, + isUnlimited: true, tags: true, }) .partial(); diff --git a/src/generated/schema.gql b/src/generated/schema.gql index cac90261..d75f2776 100644 --- a/src/generated/schema.gql +++ b/src/generated/schema.gql @@ -899,6 +899,7 @@ input TicketCreateInput { If the ticket is free, the price submitted will be ignored. """ isFree: Boolean! + maxTicketsPerUser: Int name: String! prices: [PricingInputField!] quantity: Int diff --git a/src/generated/types.ts b/src/generated/types.ts index 97c76da2..453f07d6 100644 --- a/src/generated/types.ts +++ b/src/generated/types.ts @@ -920,6 +920,7 @@ export type TicketCreateInput = { imageLink?: InputMaybe; /** If the ticket is free, the price submitted will be ignored. */ isFree: Scalars["Boolean"]["input"]; + maxTicketsPerUser?: InputMaybe; name: Scalars["String"]["input"]; prices?: InputMaybe>; quantity?: InputMaybe; diff --git a/src/schema/ticket/mutations.ts b/src/schema/ticket/mutations.ts index 4e88931a..4aaca871 100644 --- a/src/schema/ticket/mutations.ts +++ b/src/schema/ticket/mutations.ts @@ -69,6 +69,9 @@ const TicketCreateInput = builder.inputType("TicketCreateInput", { imageLink: t.string({ required: false, }), + maxTicketsPerUser: t.int({ + required: false, + }), externalLink: t.string({ required: false, }), @@ -239,6 +242,7 @@ builder.mutationField("createTicket", (t) => isFree: input.isFree, imageLink: input.imageLink, externalLink: input.externalLink, + maxTicketsPerUser: input.maxTicketsPerUser, tags: [ ...new Set(input.tags?.map((tag) => tag.trim().toLowerCase())), ],