diff --git a/drizzle_migrations/meta/20250122092015_snapshot.json b/drizzle_migrations/meta/20250122092015_snapshot.json index bafdef2ed0b..efdbe144da3 100644 --- a/drizzle_migrations/meta/20250122092015_snapshot.json +++ b/drizzle_migrations/meta/20250122092015_snapshot.json @@ -1,6174 +1,5716 @@ { - "id": "e5fe635f-2302-4a95-86e6-16508bb68c63", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.action_categories": { - "name": "action_categories", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "is_disabled": { - "name": "is_disabled", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "action_categories_created_at_index": { - "name": "action_categories_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_categories_creator_id_index": { - "name": "action_categories_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_categories_name_index": { - "name": "action_categories_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_categories_name_organization_id_index": { - "name": "action_categories_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_categories_creator_id_users_id_fk": { - "name": "action_categories_creator_id_users_id_fk", - "tableFrom": "action_categories", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "action_categories_organization_id_organizations_id_fk": { - "name": "action_categories_organization_id_organizations_id_fk", - "tableFrom": "action_categories", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "action_categories_updater_id_users_id_fk": { - "name": "action_categories_updater_id_users_id_fk", - "tableFrom": "action_categories", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.actions": { - "name": "actions", - "schema": "", - "columns": { - "assigned_at": { - "name": "assigned_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "actor_id": { - "name": "actor_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "category_id": { - "name": "category_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "completion_at": { - "name": "completion_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "is_completed": { - "name": "is_completed", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "post_completion_notes": { - "name": "post_completion_notes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "pre_completion_notes": { - "name": "pre_completion_notes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "actions_assigned_at_index": { - "name": "actions_assigned_at_index", - "columns": [ - { - "expression": "assigned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_actor_id_index": { - "name": "actions_actor_id_index", - "columns": [ - { - "expression": "actor_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_category_id_index": { - "name": "actions_category_id_index", - "columns": [ - { - "expression": "category_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_completion_at_index": { - "name": "actions_completion_at_index", - "columns": [ - { - "expression": "completion_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_created_at_index": { - "name": "actions_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_creator_id_index": { - "name": "actions_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "actions_organization_id_index": { - "name": "actions_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "actions_actor_id_users_id_fk": { - "name": "actions_actor_id_users_id_fk", - "tableFrom": "actions", - "tableTo": "users", - "columnsFrom": [ - "actor_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "actions_category_id_action_categories_id_fk": { - "name": "actions_category_id_action_categories_id_fk", - "tableFrom": "actions", - "tableTo": "action_categories", - "columnsFrom": [ - "category_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "actions_creator_id_users_id_fk": { - "name": "actions_creator_id_users_id_fk", - "tableFrom": "actions", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "actions_event_id_events_id_fk": { - "name": "actions_event_id_events_id_fk", - "tableFrom": "actions", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "actions_organization_id_organizations_id_fk": { - "name": "actions_organization_id_organizations_id_fk", - "tableFrom": "actions", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "actions_updater_id_users_id_fk": { - "name": "actions_updater_id_users_id_fk", - "tableFrom": "actions", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.advertisement_attachments": { - "name": "advertisement_attachments", - "schema": "", - "columns": { - "advertisement_id": { - "name": "advertisement_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "advertisement_attachments_advertisement_id_index": { - "name": "advertisement_attachments_advertisement_id_index", - "columns": [ - { - "expression": "advertisement_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisement_attachments_created_at_index": { - "name": "advertisement_attachments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisement_attachments_creator_id_index": { - "name": "advertisement_attachments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "advertisement_attachments_advertisement_id_advertisements_id_fk": { - "name": "advertisement_attachments_advertisement_id_advertisements_id_fk", - "tableFrom": "advertisement_attachments", - "tableTo": "advertisements", - "columnsFrom": [ - "advertisement_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "advertisement_attachments_creator_id_users_id_fk": { - "name": "advertisement_attachments_creator_id_users_id_fk", - "tableFrom": "advertisement_attachments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "advertisement_attachments_updater_id_users_id_fk": { - "name": "advertisement_attachments_updater_id_users_id_fk", - "tableFrom": "advertisement_attachments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.advertisements": { - "name": "advertisements", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "start_at": { - "name": "start_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "advertisements_creator_id_index": { - "name": "advertisements_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisements_end_at_index": { - "name": "advertisements_end_at_index", - "columns": [ - { - "expression": "end_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisements_name_index": { - "name": "advertisements_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisements_organization_id_index": { - "name": "advertisements_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisements_start_at_index": { - "name": "advertisements_start_at_index", - "columns": [ - { - "expression": "start_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "advertisements_name_organization_id_index": { - "name": "advertisements_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "advertisements_creator_id_users_id_fk": { - "name": "advertisements_creator_id_users_id_fk", - "tableFrom": "advertisements", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "advertisements_organization_id_organizations_id_fk": { - "name": "advertisements_organization_id_organizations_id_fk", - "tableFrom": "advertisements", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "advertisements_updater_id_users_id_fk": { - "name": "advertisements_updater_id_users_id_fk", - "tableFrom": "advertisements", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.agenda_folders": { - "name": "agenda_folders", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "is_agenda_item_folder": { - "name": "is_agenda_item_folder", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_folder_id": { - "name": "parent_folder_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "agenda_folders_created_at_index": { - "name": "agenda_folders_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_folders_creator_id_index": { - "name": "agenda_folders_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_folders_event_id_index": { - "name": "agenda_folders_event_id_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_folders_is_agenda_item_folder_index": { - "name": "agenda_folders_is_agenda_item_folder_index", - "columns": [ - { - "expression": "is_agenda_item_folder", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_folders_name_index": { - "name": "agenda_folders_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_folders_parent_folder_id_index": { - "name": "agenda_folders_parent_folder_id_index", - "columns": [ - { - "expression": "parent_folder_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "agenda_folders_creator_id_users_id_fk": { - "name": "agenda_folders_creator_id_users_id_fk", - "tableFrom": "agenda_folders", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "agenda_folders_event_id_events_id_fk": { - "name": "agenda_folders_event_id_events_id_fk", - "tableFrom": "agenda_folders", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "agenda_folders_parent_folder_id_agenda_folders_id_fk": { - "name": "agenda_folders_parent_folder_id_agenda_folders_id_fk", - "tableFrom": "agenda_folders", - "tableTo": "agenda_folders", - "columnsFrom": [ - "parent_folder_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "agenda_folders_updater_id_users_id_fk": { - "name": "agenda_folders_updater_id_users_id_fk", - "tableFrom": "agenda_folders", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.agenda_items": { - "name": "agenda_items", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "duration": { - "name": "duration", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "folder_id": { - "name": "folder_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "agenda_items_created_at_index": { - "name": "agenda_items_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_items_creator_id_index": { - "name": "agenda_items_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_items_folder_id_index": { - "name": "agenda_items_folder_id_index", - "columns": [ - { - "expression": "folder_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_items_name_index": { - "name": "agenda_items_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "agenda_items_type_index": { - "name": "agenda_items_type_index", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "agenda_items_creator_id_users_id_fk": { - "name": "agenda_items_creator_id_users_id_fk", - "tableFrom": "agenda_items", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "agenda_items_folder_id_agenda_folders_id_fk": { - "name": "agenda_items_folder_id_agenda_folders_id_fk", - "tableFrom": "agenda_items", - "tableTo": "agenda_folders", - "columnsFrom": [ - "folder_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "agenda_items_updater_id_users_id_fk": { - "name": "agenda_items_updater_id_users_id_fk", - "tableFrom": "agenda_items", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.chat_memberships": { - "name": "chat_memberships", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "chat_id": { - "name": "chat_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "member_id": { - "name": "member_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "chat_memberships_chat_id_index": { - "name": "chat_memberships_chat_id_index", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_memberships_created_at_index": { - "name": "chat_memberships_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_memberships_creator_id_index": { - "name": "chat_memberships_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_memberships_member_id_index": { - "name": "chat_memberships_member_id_index", - "columns": [ - { - "expression": "member_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_memberships_role_index": { - "name": "chat_memberships_role_index", - "columns": [ - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_memberships_creator_id_users_id_fk": { - "name": "chat_memberships_creator_id_users_id_fk", - "tableFrom": "chat_memberships", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "chat_memberships_chat_id_chats_id_fk": { - "name": "chat_memberships_chat_id_chats_id_fk", - "tableFrom": "chat_memberships", - "tableTo": "chats", - "columnsFrom": [ - "chat_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "chat_memberships_member_id_users_id_fk": { - "name": "chat_memberships_member_id_users_id_fk", - "tableFrom": "chat_memberships", - "tableTo": "users", - "columnsFrom": [ - "member_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "chat_memberships_updater_id_users_id_fk": { - "name": "chat_memberships_updater_id_users_id_fk", - "tableFrom": "chat_memberships", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "chat_memberships_chat_id_member_id_pk": { - "name": "chat_memberships_chat_id_member_id_pk", - "columns": [ - "chat_id", - "member_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.chat_messages": { - "name": "chat_messages", - "schema": "", - "columns": { - "body": { - "name": "body", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "chat_id": { - "name": "chat_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "parent_message_id": { - "name": "parent_message_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "chat_messages_chat_id_index": { - "name": "chat_messages_chat_id_index", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_messages_created_at_index": { - "name": "chat_messages_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_messages_creator_id_index": { - "name": "chat_messages_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chat_messages_parent_message_id_index": { - "name": "chat_messages_parent_message_id_index", - "columns": [ - { - "expression": "parent_message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_messages_chat_id_chats_id_fk": { - "name": "chat_messages_chat_id_chats_id_fk", - "tableFrom": "chat_messages", - "tableTo": "chats", - "columnsFrom": [ - "chat_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "chat_messages_creator_id_users_id_fk": { - "name": "chat_messages_creator_id_users_id_fk", - "tableFrom": "chat_messages", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "chat_messages_parent_message_id_chat_messages_id_fk": { - "name": "chat_messages_parent_message_id_chat_messages_id_fk", - "tableFrom": "chat_messages", - "tableTo": "chat_messages", - "columnsFrom": [ - "parent_message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.chats": { - "name": "chats", - "schema": "", - "columns": { - "avatar_mime_type": { - "name": "avatar_mime_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_name": { - "name": "avatar_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "chats_creator_id_index": { - "name": "chats_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chats_name_index": { - "name": "chats_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chats_organization_id_index": { - "name": "chats_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chats_updater_id_index": { - "name": "chats_updater_id_index", - "columns": [ - { - "expression": "updater_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chats_creator_id_users_id_fk": { - "name": "chats_creator_id_users_id_fk", - "tableFrom": "chats", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "chats_organization_id_organizations_id_fk": { - "name": "chats_organization_id_organizations_id_fk", - "tableFrom": "chats", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "chats_updater_id_users_id_fk": { - "name": "chats_updater_id_users_id_fk", - "tableFrom": "chats", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chats_name_unique": { - "name": "chats_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.comment_votes": { - "name": "comment_votes", - "schema": "", - "columns": { - "comment_id": { - "name": "comment_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "comment_votes_comment_id_index": { - "name": "comment_votes_comment_id_index", - "columns": [ - { - "expression": "comment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "comment_votes_creator_id_index": { - "name": "comment_votes_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "comment_votes_type_index": { - "name": "comment_votes_type_index", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "comment_votes_comment_id_creator_id_index": { - "name": "comment_votes_comment_id_creator_id_index", - "columns": [ - { - "expression": "comment_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comment_votes_comment_id_comments_id_fk": { - "name": "comment_votes_comment_id_comments_id_fk", - "tableFrom": "comment_votes", - "tableTo": "comments", - "columnsFrom": [ - "comment_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "comment_votes_creator_id_users_id_fk": { - "name": "comment_votes_creator_id_users_id_fk", - "tableFrom": "comment_votes", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.comments": { - "name": "comments", - "schema": "", - "columns": { - "body": { - "name": "body", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "comments_created_at_index": { - "name": "comments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "comments_creator_id_index": { - "name": "comments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "comments_post_id_index": { - "name": "comments_post_id_index", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comments_creator_id_users_id_fk": { - "name": "comments_creator_id_users_id_fk", - "tableFrom": "comments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "comments_post_id_posts_id_fk": { - "name": "comments_post_id_posts_id_fk", - "tableFrom": "comments", - "tableTo": "posts", - "columnsFrom": [ - "post_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.communities": { - "name": "communities", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "facebook_url": { - "name": "facebook_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "github_url": { - "name": "github_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "inactivity_timeout_duration": { - "name": "inactivity_timeout_duration", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "instagram_url": { - "name": "instagram_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "linkedin_url": { - "name": "linkedin_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "logo_mime_type": { - "name": "logo_mime_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "logo_name": { - "name": "logo_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reddit_url": { - "name": "reddit_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slack_url": { - "name": "slack_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "website_url": { - "name": "website_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "x_url": { - "name": "x_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "youtube_url": { - "name": "youtube_url", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "communities_updater_id_users_id_fk": { - "name": "communities_updater_id_users_id_fk", - "tableFrom": "communities", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "communities_name_unique": { - "name": "communities_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.event_attachments": { - "name": "event_attachments", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "event_attachments_event_id_index": { - "name": "event_attachments_event_id_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attachments_created_at_index": { - "name": "event_attachments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attachments_creator_id_index": { - "name": "event_attachments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "event_attachments_creator_id_users_id_fk": { - "name": "event_attachments_creator_id_users_id_fk", - "tableFrom": "event_attachments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "event_attachments_event_id_events_id_fk": { - "name": "event_attachments_event_id_events_id_fk", - "tableFrom": "event_attachments", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "event_attachments_updater_id_users_id_fk": { - "name": "event_attachments_updater_id_users_id_fk", - "tableFrom": "event_attachments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.event_attendances": { - "name": "event_attendances", - "schema": "", - "columns": { - "attendee_id": { - "name": "attendee_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "check_in_at": { - "name": "check_in_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "check_out_at": { - "name": "check_out_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "event_attendances_attendee_id_index": { - "name": "event_attendances_attendee_id_index", - "columns": [ - { - "expression": "attendee_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attendances_check_in_at_index": { - "name": "event_attendances_check_in_at_index", - "columns": [ - { - "expression": "check_in_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attendances_check_out_at_index": { - "name": "event_attendances_check_out_at_index", - "columns": [ - { - "expression": "check_out_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attendances_created_at_index": { - "name": "event_attendances_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attendances_creator_id_index": { - "name": "event_attendances_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "event_attendances_event_id_index": { - "name": "event_attendances_event_id_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "event_attendances_attendee_id_users_id_fk": { - "name": "event_attendances_attendee_id_users_id_fk", - "tableFrom": "event_attendances", - "tableTo": "users", - "columnsFrom": [ - "attendee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "event_attendances_creator_id_users_id_fk": { - "name": "event_attendances_creator_id_users_id_fk", - "tableFrom": "event_attendances", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "event_attendances_event_id_events_id_fk": { - "name": "event_attendances_event_id_events_id_fk", - "tableFrom": "event_attendances", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "event_attendances_updater_id_users_id_fk": { - "name": "event_attendances_updater_id_users_id_fk", - "tableFrom": "event_attendances", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.events": { - "name": "events", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "end_at": { - "name": "end_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "start_at": { - "name": "start_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "events_created_at_index": { - "name": "events_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "events_creator_id_index": { - "name": "events_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "events_end_at_index": { - "name": "events_end_at_index", - "columns": [ - { - "expression": "end_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "events_name_index": { - "name": "events_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "events_organization_id_index": { - "name": "events_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "events_start_at_index": { - "name": "events_start_at_index", - "columns": [ - { - "expression": "start_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "events_creator_id_users_id_fk": { - "name": "events_creator_id_users_id_fk", - "tableFrom": "events", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "events_organization_id_organizations_id_fk": { - "name": "events_organization_id_organizations_id_fk", - "tableFrom": "events", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "events_updater_id_users_id_fk": { - "name": "events_updater_id_users_id_fk", - "tableFrom": "events", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.families": { - "name": "families", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "families_created_at_index": { - "name": "families_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "families_creator_id_index": { - "name": "families_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "families_name_index": { - "name": "families_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "families_organization_id_index": { - "name": "families_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "families_name_organization_id_index": { - "name": "families_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "families_creator_id_users_id_fk": { - "name": "families_creator_id_users_id_fk", - "tableFrom": "families", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "families_organization_id_organizations_id_fk": { - "name": "families_organization_id_organizations_id_fk", - "tableFrom": "families", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "families_updater_id_users_id_fk": { - "name": "families_updater_id_users_id_fk", - "tableFrom": "families", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.family_memberships": { - "name": "family_memberships", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "family_id": { - "name": "family_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "member_id": { - "name": "member_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "family_memberships_created_at_index": { - "name": "family_memberships_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "family_memberships_creator_id_index": { - "name": "family_memberships_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "family_memberships_family_id_index": { - "name": "family_memberships_family_id_index", - "columns": [ - { - "expression": "family_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "family_memberships_member_id_index": { - "name": "family_memberships_member_id_index", - "columns": [ - { - "expression": "member_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "family_memberships_creator_id_users_id_fk": { - "name": "family_memberships_creator_id_users_id_fk", - "tableFrom": "family_memberships", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "family_memberships_family_id_families_id_fk": { - "name": "family_memberships_family_id_families_id_fk", - "tableFrom": "family_memberships", - "tableTo": "families", - "columnsFrom": [ - "family_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "family_memberships_member_id_users_id_fk": { - "name": "family_memberships_member_id_users_id_fk", - "tableFrom": "family_memberships", - "tableTo": "users", - "columnsFrom": [ - "member_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "family_memberships_updater_id_users_id_fk": { - "name": "family_memberships_updater_id_users_id_fk", - "tableFrom": "family_memberships", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "family_memberships_family_id_member_id_pk": { - "name": "family_memberships_family_id_member_id_pk", - "columns": [ - "family_id", - "member_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.fund_campaign_pledges": { - "name": "fund_campaign_pledges", - "schema": "", - "columns": { - "amount": { - "name": "amount", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "campaign_id": { - "name": "campaign_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "pledger_id": { - "name": "pledger_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "fund_campaign_pledges_campaign_id_index": { - "name": "fund_campaign_pledges_campaign_id_index", - "columns": [ - { - "expression": "campaign_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaign_pledges_created_at_index": { - "name": "fund_campaign_pledges_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaign_pledges_creator_id_index": { - "name": "fund_campaign_pledges_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaign_pledges_pledger_id_index": { - "name": "fund_campaign_pledges_pledger_id_index", - "columns": [ - { - "expression": "pledger_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaign_pledges_campaign_id_pledger_id_index": { - "name": "fund_campaign_pledges_campaign_id_pledger_id_index", - "columns": [ - { - "expression": "campaign_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "pledger_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fund_campaign_pledges_campaign_id_fund_campaigns_id_fk": { - "name": "fund_campaign_pledges_campaign_id_fund_campaigns_id_fk", - "tableFrom": "fund_campaign_pledges", - "tableTo": "fund_campaigns", - "columnsFrom": [ - "campaign_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "fund_campaign_pledges_creator_id_users_id_fk": { - "name": "fund_campaign_pledges_creator_id_users_id_fk", - "tableFrom": "fund_campaign_pledges", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "fund_campaign_pledges_pledger_id_users_id_fk": { - "name": "fund_campaign_pledges_pledger_id_users_id_fk", - "tableFrom": "fund_campaign_pledges", - "tableTo": "users", - "columnsFrom": [ - "pledger_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "fund_campaign_pledges_updater_id_users_id_fk": { - "name": "fund_campaign_pledges_updater_id_users_id_fk", - "tableFrom": "fund_campaign_pledges", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.fund_campaigns": { - "name": "fund_campaigns", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "currency_code": { - "name": "currency_code", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "end_at": { - "name": "end_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "fund_id": { - "name": "fund_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "goal_amount": { - "name": "goal_amount", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "start_at": { - "name": "start_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "fund_campaigns_created_at_index": { - "name": "fund_campaigns_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_creator_id_index": { - "name": "fund_campaigns_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_end_at_index": { - "name": "fund_campaigns_end_at_index", - "columns": [ - { - "expression": "end_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_fund_id_index": { - "name": "fund_campaigns_fund_id_index", - "columns": [ - { - "expression": "fund_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_name_index": { - "name": "fund_campaigns_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_start_at_index": { - "name": "fund_campaigns_start_at_index", - "columns": [ - { - "expression": "start_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "fund_campaigns_fund_id_name_index": { - "name": "fund_campaigns_fund_id_name_index", - "columns": [ - { - "expression": "fund_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fund_campaigns_creator_id_users_id_fk": { - "name": "fund_campaigns_creator_id_users_id_fk", - "tableFrom": "fund_campaigns", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "fund_campaigns_fund_id_funds_id_fk": { - "name": "fund_campaigns_fund_id_funds_id_fk", - "tableFrom": "fund_campaigns", - "tableTo": "funds", - "columnsFrom": [ - "fund_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "fund_campaigns_updater_id_users_id_fk": { - "name": "fund_campaigns_updater_id_users_id_fk", - "tableFrom": "fund_campaigns", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.funds": { - "name": "funds", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "is_tax_deductible": { - "name": "is_tax_deductible", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "funds_created_at_index": { - "name": "funds_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "funds_creator_id_index": { - "name": "funds_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "funds_name_index": { - "name": "funds_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "funds_organization_id_index": { - "name": "funds_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "funds_name_organization_id_index": { - "name": "funds_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "funds_creator_id_users_id_fk": { - "name": "funds_creator_id_users_id_fk", - "tableFrom": "funds", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "funds_organization_id_organizations_id_fk": { - "name": "funds_organization_id_organizations_id_fk", - "tableFrom": "funds", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "funds_updater_id_users_id_fk": { - "name": "funds_updater_id_users_id_fk", - "tableFrom": "funds", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.organization_memberships": { - "name": "organization_memberships", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "member_id": { - "name": "member_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "organization_memberships_created_at_index": { - "name": "organization_memberships_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organization_memberships_creator_id_index": { - "name": "organization_memberships_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organization_memberships_member_id_index": { - "name": "organization_memberships_member_id_index", - "columns": [ - { - "expression": "member_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organization_memberships_organization_id_index": { - "name": "organization_memberships_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organization_memberships_role_index": { - "name": "organization_memberships_role_index", - "columns": [ - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "organization_memberships_creator_id_users_id_fk": { - "name": "organization_memberships_creator_id_users_id_fk", - "tableFrom": "organization_memberships", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "organization_memberships_member_id_users_id_fk": { - "name": "organization_memberships_member_id_users_id_fk", - "tableFrom": "organization_memberships", - "tableTo": "users", - "columnsFrom": [ - "member_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "organization_memberships_organization_id_organizations_id_fk": { - "name": "organization_memberships_organization_id_organizations_id_fk", - "tableFrom": "organization_memberships", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "organization_memberships_updater_id_users_id_fk": { - "name": "organization_memberships_updater_id_users_id_fk", - "tableFrom": "organization_memberships", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "organization_memberships_member_id_organization_id_pk": { - "name": "organization_memberships_member_id_organization_id_pk", - "columns": [ - "member_id", - "organization_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.organizations": { - "name": "organizations", - "schema": "", - "columns": { - "address_line_1": { - "name": "address_line_1", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "address_line_2": { - "name": "address_line_2", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_mime_type": { - "name": "avatar_mime_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_name": { - "name": "avatar_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "city": { - "name": "city", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "postal_code": { - "name": "postal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "organizations_creator_id_index": { - "name": "organizations_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organizations_name_index": { - "name": "organizations_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "organizations_updater_id_index": { - "name": "organizations_updater_id_index", - "columns": [ - { - "expression": "updater_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "organizations_creator_id_users_id_fk": { - "name": "organizations_creator_id_users_id_fk", - "tableFrom": "organizations", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "organizations_updater_id_users_id_fk": { - "name": "organizations_updater_id_users_id_fk", - "tableFrom": "organizations", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "organizations_name_unique": { - "name": "organizations_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.post_attachments": { - "name": "post_attachments", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "post_id": { - "name": "post_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "post_attachments_created_at_index": { - "name": "post_attachments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "post_attachments_creator_id_index": { - "name": "post_attachments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "post_attachments_post_id_index": { - "name": "post_attachments_post_id_index", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "post_attachments_creator_id_users_id_fk": { - "name": "post_attachments_creator_id_users_id_fk", - "tableFrom": "post_attachments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "post_attachments_post_id_posts_id_fk": { - "name": "post_attachments_post_id_posts_id_fk", - "tableFrom": "post_attachments", - "tableTo": "posts", - "columnsFrom": [ - "post_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "post_attachments_updater_id_users_id_fk": { - "name": "post_attachments_updater_id_users_id_fk", - "tableFrom": "post_attachments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.post_votes": { - "name": "post_votes", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "post_votes_creator_id_index": { - "name": "post_votes_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "post_votes_post_id_index": { - "name": "post_votes_post_id_index", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "post_votes_type_index": { - "name": "post_votes_type_index", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "post_votes_creator_id_post_id_index": { - "name": "post_votes_creator_id_post_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "post_votes_creator_id_users_id_fk": { - "name": "post_votes_creator_id_users_id_fk", - "tableFrom": "post_votes", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "post_votes_post_id_posts_id_fk": { - "name": "post_votes_post_id_posts_id_fk", - "tableFrom": "post_votes", - "tableTo": "posts", - "columnsFrom": [ - "post_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.posts": { - "name": "posts", - "schema": "", - "columns": { - "caption": { - "name": "caption", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "pinned_at": { - "name": "pinned_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "posts_created_at_index": { - "name": "posts_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "posts_creator_id_index": { - "name": "posts_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "posts_pinned_at_index": { - "name": "posts_pinned_at_index", - "columns": [ - { - "expression": "pinned_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "posts_organization_id_index": { - "name": "posts_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "posts_creator_id_users_id_fk": { - "name": "posts_creator_id_users_id_fk", - "tableFrom": "posts", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "posts_organization_id_organizations_id_fk": { - "name": "posts_organization_id_organizations_id_fk", - "tableFrom": "posts", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "posts_updater_id_users_id_fk": { - "name": "posts_updater_id_users_id_fk", - "tableFrom": "posts", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tag_assignments": { - "name": "tag_assignments", - "schema": "", - "columns": { - "assignee_id": { - "name": "assignee_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "tag_id": { - "name": "tag_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "tag_assignments_assignee_id_index": { - "name": "tag_assignments_assignee_id_index", - "columns": [ - { - "expression": "assignee_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_assignments_created_at_index": { - "name": "tag_assignments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_assignments_creator_id_index": { - "name": "tag_assignments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_assignments_tag_id_index": { - "name": "tag_assignments_tag_id_index", - "columns": [ - { - "expression": "tag_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tag_assignments_assignee_id_users_id_fk": { - "name": "tag_assignments_assignee_id_users_id_fk", - "tableFrom": "tag_assignments", - "tableTo": "users", - "columnsFrom": [ - "assignee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "tag_assignments_creator_id_users_id_fk": { - "name": "tag_assignments_creator_id_users_id_fk", - "tableFrom": "tag_assignments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "tag_assignments_tag_id_tags_id_fk": { - "name": "tag_assignments_tag_id_tags_id_fk", - "tableFrom": "tag_assignments", - "tableTo": "tags", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "tag_assignments_assignee_id_tag_id_pk": { - "name": "tag_assignments_assignee_id_tag_id_pk", - "columns": [ - "assignee_id", - "tag_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tag_folders": { - "name": "tag_folders", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "parent_folder_id": { - "name": "parent_folder_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tag_folders_created_at_index": { - "name": "tag_folders_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_folders_creator_id_index": { - "name": "tag_folders_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_folders_name_index": { - "name": "tag_folders_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_folders_organization_id_index": { - "name": "tag_folders_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tag_folders_parent_folder_id_index": { - "name": "tag_folders_parent_folder_id_index", - "columns": [ - { - "expression": "parent_folder_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tag_folders_creator_id_users_id_fk": { - "name": "tag_folders_creator_id_users_id_fk", - "tableFrom": "tag_folders", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "tag_folders_organization_id_organizations_id_fk": { - "name": "tag_folders_organization_id_organizations_id_fk", - "tableFrom": "tag_folders", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "tag_folders_parent_folder_id_tag_folders_id_fk": { - "name": "tag_folders_parent_folder_id_tag_folders_id_fk", - "tableFrom": "tag_folders", - "tableTo": "tag_folders", - "columnsFrom": [ - "parent_folder_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "tag_folders_updater_id_users_id_fk": { - "name": "tag_folders_updater_id_users_id_fk", - "tableFrom": "tag_folders", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tags": { - "name": "tags", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "folder_id": { - "name": "folder_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tags_creator_id_index": { - "name": "tags_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tags_name_index": { - "name": "tags_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tags_organization_id_index": { - "name": "tags_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tags_name_organization_id_index": { - "name": "tags_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tags_creator_id_users_id_fk": { - "name": "tags_creator_id_users_id_fk", - "tableFrom": "tags", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "tags_folder_id_tag_folders_id_fk": { - "name": "tags_folder_id_tag_folders_id_fk", - "tableFrom": "tags", - "tableTo": "tag_folders", - "columnsFrom": [ - "folder_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "tags_organization_id_organizations_id_fk": { - "name": "tags_organization_id_organizations_id_fk", - "tableFrom": "tags", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "tags_updater_id_users_id_fk": { - "name": "tags_updater_id_users_id_fk", - "tableFrom": "tags", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "address_line_1": { - "name": "address_line_1", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "address_line_2": { - "name": "address_line_2", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_mime_type": { - "name": "avatar_mime_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_name": { - "name": "avatar_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "birth_date": { - "name": "birth_date", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "city": { - "name": "city", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "education_grade": { - "name": "education_grade", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_address": { - "name": "email_address", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "employment_status": { - "name": "employment_status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "home_phone_number": { - "name": "home_phone_number", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "is_email_address_verified": { - "name": "is_email_address_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "marital_status": { - "name": "marital_status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "mobile_phone_number": { - "name": "mobile_phone_number", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "natal_sex": { - "name": "natal_sex", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "natural_language_code": { - "name": "natural_language_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password_hash": { - "name": "password_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "postal_code": { - "name": "postal_code", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "state": { - "name": "state", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "work_phone_number": { - "name": "work_phone_number", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "users_creator_id_index": { - "name": "users_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_index": { - "name": "users_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_updater_id_index": { - "name": "users_updater_id_index", - "columns": [ - { - "expression": "updater_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "users_creator_id_users_id_fk": { - "name": "users_creator_id_users_id_fk", - "tableFrom": "users", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "users_updater_id_users_id_fk": { - "name": "users_updater_id_users_id_fk", - "tableFrom": "users", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_address_unique": { - "name": "users_email_address_unique", - "nullsNotDistinct": false, - "columns": [ - "email_address" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.venue_attachments": { - "name": "venue_attachments", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "venue_id": { - "name": "venue_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "venue_attachments_created_at_index": { - "name": "venue_attachments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venue_attachments_creator_id_index": { - "name": "venue_attachments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venue_attachments_venue_id_index": { - "name": "venue_attachments_venue_id_index", - "columns": [ - { - "expression": "venue_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "venue_attachments_creator_id_users_id_fk": { - "name": "venue_attachments_creator_id_users_id_fk", - "tableFrom": "venue_attachments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "venue_attachments_updater_id_users_id_fk": { - "name": "venue_attachments_updater_id_users_id_fk", - "tableFrom": "venue_attachments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "venue_attachments_venue_id_venues_id_fk": { - "name": "venue_attachments_venue_id_venues_id_fk", - "tableFrom": "venue_attachments", - "tableTo": "venues", - "columnsFrom": [ - "venue_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.venue_bookings": { - "name": "venue_bookings", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "venue_id": { - "name": "venue_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "venue_bookings_created_at_index": { - "name": "venue_bookings_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venue_bookings_creator_id_index": { - "name": "venue_bookings_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venue_bookings_event_id_index": { - "name": "venue_bookings_event_id_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venue_bookings_venue_id_index": { - "name": "venue_bookings_venue_id_index", - "columns": [ - { - "expression": "venue_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "venue_bookings_creator_id_users_id_fk": { - "name": "venue_bookings_creator_id_users_id_fk", - "tableFrom": "venue_bookings", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "venue_bookings_event_id_events_id_fk": { - "name": "venue_bookings_event_id_events_id_fk", - "tableFrom": "venue_bookings", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "venue_bookings_venue_id_venues_id_fk": { - "name": "venue_bookings_venue_id_venues_id_fk", - "tableFrom": "venue_bookings", - "tableTo": "venues", - "columnsFrom": [ - "venue_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "venue_bookings_event_id_venue_id_pk": { - "name": "venue_bookings_event_id_venue_id_pk", - "columns": [ - "event_id", - "venue_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.venues": { - "name": "venues", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "venues_created_at_index": { - "name": "venues_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venues_creator_id_index": { - "name": "venues_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venues_name_index": { - "name": "venues_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venues_organization_id_index": { - "name": "venues_organization_id_index", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "venues_name_organization_id_index": { - "name": "venues_name_organization_id_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "venues_creator_id_users_id_fk": { - "name": "venues_creator_id_users_id_fk", - "tableFrom": "venues", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "venues_organization_id_organizations_id_fk": { - "name": "venues_organization_id_organizations_id_fk", - "tableFrom": "venues", - "tableTo": "organizations", - "columnsFrom": [ - "organization_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "venues_updater_id_users_id_fk": { - "name": "venues_updater_id_users_id_fk", - "tableFrom": "venues", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.volunteer_group_assignments": { - "name": "volunteer_group_assignments", - "schema": "", - "columns": { - "assignee_id": { - "name": "assignee_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "group_id": { - "name": "group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "invite_status": { - "name": "invite_status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "volunteer_group_assignments_created_at_index": { - "name": "volunteer_group_assignments_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_group_assignments_creator_id_index": { - "name": "volunteer_group_assignments_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_group_assignments_group_id_index": { - "name": "volunteer_group_assignments_group_id_index", - "columns": [ - { - "expression": "group_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "volunteer_group_assignments_assignee_id_users_id_fk": { - "name": "volunteer_group_assignments_assignee_id_users_id_fk", - "tableFrom": "volunteer_group_assignments", - "tableTo": "users", - "columnsFrom": [ - "assignee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "volunteer_group_assignments_creator_id_users_id_fk": { - "name": "volunteer_group_assignments_creator_id_users_id_fk", - "tableFrom": "volunteer_group_assignments", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "volunteer_group_assignments_group_id_volunteer_groups_id_fk": { - "name": "volunteer_group_assignments_group_id_volunteer_groups_id_fk", - "tableFrom": "volunteer_group_assignments", - "tableTo": "volunteer_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "volunteer_group_assignments_updater_id_users_id_fk": { - "name": "volunteer_group_assignments_updater_id_users_id_fk", - "tableFrom": "volunteer_group_assignments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": { - "volunteer_group_assignments_assignee_id_group_id_pk": { - "name": "volunteer_group_assignments_assignee_id_group_id_pk", - "columns": [ - "assignee_id", - "group_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.volunteer_groups": { - "name": "volunteer_groups", - "schema": "", - "columns": { - "created_at": { - "name": "created_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "event_id": { - "name": "event_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "leader_id": { - "name": "leader_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "max_volunteer_count": { - "name": "max_volunteer_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "volunteer_groups_created_at_index": { - "name": "volunteer_groups_created_at_index", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_groups_creator_id_index": { - "name": "volunteer_groups_creator_id_index", - "columns": [ - { - "expression": "creator_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_groups_event_id_index": { - "name": "volunteer_groups_event_id_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_groups_leader_id_index": { - "name": "volunteer_groups_leader_id_index", - "columns": [ - { - "expression": "leader_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_groups_name_index": { - "name": "volunteer_groups_name_index", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "volunteer_groups_event_id_name_index": { - "name": "volunteer_groups_event_id_name_index", - "columns": [ - { - "expression": "event_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "volunteer_groups_creator_id_users_id_fk": { - "name": "volunteer_groups_creator_id_users_id_fk", - "tableFrom": "volunteer_groups", - "tableTo": "users", - "columnsFrom": [ - "creator_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "volunteer_groups_event_id_events_id_fk": { - "name": "volunteer_groups_event_id_events_id_fk", - "tableFrom": "volunteer_groups", - "tableTo": "events", - "columnsFrom": [ - "event_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "volunteer_groups_leader_id_users_id_fk": { - "name": "volunteer_groups_leader_id_users_id_fk", - "tableFrom": "volunteer_groups", - "tableTo": "users", - "columnsFrom": [ - "leader_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - }, - "volunteer_groups_updater_id_users_id_fk": { - "name": "volunteer_groups_updater_id_users_id_fk", - "tableFrom": "volunteer_groups", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file + "id": "e5fe635f-2302-4a95-86e6-16508bb68c63", + "prevId": "00000000-0000-0000-0000-000000000000", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.action_categories": { + "name": "action_categories", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_disabled": { + "name": "is_disabled", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "action_categories_created_at_index": { + "name": "action_categories_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "action_categories_creator_id_index": { + "name": "action_categories_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "action_categories_name_index": { + "name": "action_categories_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "action_categories_name_organization_id_index": { + "name": "action_categories_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "action_categories_creator_id_users_id_fk": { + "name": "action_categories_creator_id_users_id_fk", + "tableFrom": "action_categories", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "action_categories_organization_id_organizations_id_fk": { + "name": "action_categories_organization_id_organizations_id_fk", + "tableFrom": "action_categories", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "action_categories_updater_id_users_id_fk": { + "name": "action_categories_updater_id_users_id_fk", + "tableFrom": "action_categories", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.actions": { + "name": "actions", + "schema": "", + "columns": { + "assigned_at": { + "name": "assigned_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "actor_id": { + "name": "actor_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "completion_at": { + "name": "completion_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_completed": { + "name": "is_completed", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "post_completion_notes": { + "name": "post_completion_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pre_completion_notes": { + "name": "pre_completion_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "actions_assigned_at_index": { + "name": "actions_assigned_at_index", + "columns": [ + { + "expression": "assigned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_actor_id_index": { + "name": "actions_actor_id_index", + "columns": [ + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_category_id_index": { + "name": "actions_category_id_index", + "columns": [ + { + "expression": "category_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_completion_at_index": { + "name": "actions_completion_at_index", + "columns": [ + { + "expression": "completion_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_created_at_index": { + "name": "actions_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_creator_id_index": { + "name": "actions_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "actions_organization_id_index": { + "name": "actions_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "actions_actor_id_users_id_fk": { + "name": "actions_actor_id_users_id_fk", + "tableFrom": "actions", + "tableTo": "users", + "columnsFrom": ["actor_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "actions_category_id_action_categories_id_fk": { + "name": "actions_category_id_action_categories_id_fk", + "tableFrom": "actions", + "tableTo": "action_categories", + "columnsFrom": ["category_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "actions_creator_id_users_id_fk": { + "name": "actions_creator_id_users_id_fk", + "tableFrom": "actions", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "actions_event_id_events_id_fk": { + "name": "actions_event_id_events_id_fk", + "tableFrom": "actions", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "actions_organization_id_organizations_id_fk": { + "name": "actions_organization_id_organizations_id_fk", + "tableFrom": "actions", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "actions_updater_id_users_id_fk": { + "name": "actions_updater_id_users_id_fk", + "tableFrom": "actions", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.advertisement_attachments": { + "name": "advertisement_attachments", + "schema": "", + "columns": { + "advertisement_id": { + "name": "advertisement_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "advertisement_attachments_advertisement_id_index": { + "name": "advertisement_attachments_advertisement_id_index", + "columns": [ + { + "expression": "advertisement_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisement_attachments_created_at_index": { + "name": "advertisement_attachments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisement_attachments_creator_id_index": { + "name": "advertisement_attachments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "advertisement_attachments_advertisement_id_advertisements_id_fk": { + "name": "advertisement_attachments_advertisement_id_advertisements_id_fk", + "tableFrom": "advertisement_attachments", + "tableTo": "advertisements", + "columnsFrom": ["advertisement_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "advertisement_attachments_creator_id_users_id_fk": { + "name": "advertisement_attachments_creator_id_users_id_fk", + "tableFrom": "advertisement_attachments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "advertisement_attachments_updater_id_users_id_fk": { + "name": "advertisement_attachments_updater_id_users_id_fk", + "tableFrom": "advertisement_attachments", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.advertisements": { + "name": "advertisements", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "end_at": { + "name": "end_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "start_at": { + "name": "start_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "advertisements_creator_id_index": { + "name": "advertisements_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisements_end_at_index": { + "name": "advertisements_end_at_index", + "columns": [ + { + "expression": "end_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisements_name_index": { + "name": "advertisements_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisements_organization_id_index": { + "name": "advertisements_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisements_start_at_index": { + "name": "advertisements_start_at_index", + "columns": [ + { + "expression": "start_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "advertisements_name_organization_id_index": { + "name": "advertisements_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "advertisements_creator_id_users_id_fk": { + "name": "advertisements_creator_id_users_id_fk", + "tableFrom": "advertisements", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "advertisements_organization_id_organizations_id_fk": { + "name": "advertisements_organization_id_organizations_id_fk", + "tableFrom": "advertisements", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "advertisements_updater_id_users_id_fk": { + "name": "advertisements_updater_id_users_id_fk", + "tableFrom": "advertisements", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agenda_folders": { + "name": "agenda_folders", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_agenda_item_folder": { + "name": "is_agenda_item_folder", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_folder_id": { + "name": "parent_folder_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agenda_folders_created_at_index": { + "name": "agenda_folders_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_folders_creator_id_index": { + "name": "agenda_folders_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_folders_event_id_index": { + "name": "agenda_folders_event_id_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_folders_is_agenda_item_folder_index": { + "name": "agenda_folders_is_agenda_item_folder_index", + "columns": [ + { + "expression": "is_agenda_item_folder", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_folders_name_index": { + "name": "agenda_folders_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_folders_parent_folder_id_index": { + "name": "agenda_folders_parent_folder_id_index", + "columns": [ + { + "expression": "parent_folder_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agenda_folders_creator_id_users_id_fk": { + "name": "agenda_folders_creator_id_users_id_fk", + "tableFrom": "agenda_folders", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "agenda_folders_event_id_events_id_fk": { + "name": "agenda_folders_event_id_events_id_fk", + "tableFrom": "agenda_folders", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "agenda_folders_parent_folder_id_agenda_folders_id_fk": { + "name": "agenda_folders_parent_folder_id_agenda_folders_id_fk", + "tableFrom": "agenda_folders", + "tableTo": "agenda_folders", + "columnsFrom": ["parent_folder_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "agenda_folders_updater_id_users_id_fk": { + "name": "agenda_folders_updater_id_users_id_fk", + "tableFrom": "agenda_folders", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agenda_items": { + "name": "agenda_items", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "folder_id": { + "name": "folder_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agenda_items_created_at_index": { + "name": "agenda_items_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_items_creator_id_index": { + "name": "agenda_items_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_items_folder_id_index": { + "name": "agenda_items_folder_id_index", + "columns": [ + { + "expression": "folder_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_items_name_index": { + "name": "agenda_items_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agenda_items_type_index": { + "name": "agenda_items_type_index", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agenda_items_creator_id_users_id_fk": { + "name": "agenda_items_creator_id_users_id_fk", + "tableFrom": "agenda_items", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "agenda_items_folder_id_agenda_folders_id_fk": { + "name": "agenda_items_folder_id_agenda_folders_id_fk", + "tableFrom": "agenda_items", + "tableTo": "agenda_folders", + "columnsFrom": ["folder_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "agenda_items_updater_id_users_id_fk": { + "name": "agenda_items_updater_id_users_id_fk", + "tableFrom": "agenda_items", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_memberships": { + "name": "chat_memberships", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "chat_memberships_chat_id_index": { + "name": "chat_memberships_chat_id_index", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_memberships_created_at_index": { + "name": "chat_memberships_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_memberships_creator_id_index": { + "name": "chat_memberships_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_memberships_member_id_index": { + "name": "chat_memberships_member_id_index", + "columns": [ + { + "expression": "member_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_memberships_role_index": { + "name": "chat_memberships_role_index", + "columns": [ + { + "expression": "role", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_memberships_creator_id_users_id_fk": { + "name": "chat_memberships_creator_id_users_id_fk", + "tableFrom": "chat_memberships", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "chat_memberships_chat_id_chats_id_fk": { + "name": "chat_memberships_chat_id_chats_id_fk", + "tableFrom": "chat_memberships", + "tableTo": "chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "chat_memberships_member_id_users_id_fk": { + "name": "chat_memberships_member_id_users_id_fk", + "tableFrom": "chat_memberships", + "tableTo": "users", + "columnsFrom": ["member_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "chat_memberships_updater_id_users_id_fk": { + "name": "chat_memberships_updater_id_users_id_fk", + "tableFrom": "chat_memberships", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "chat_memberships_chat_id_member_id_pk": { + "name": "chat_memberships_chat_id_member_id_pk", + "columns": ["chat_id", "member_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_messages": { + "name": "chat_messages", + "schema": "", + "columns": { + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "parent_message_id": { + "name": "parent_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "chat_messages_chat_id_index": { + "name": "chat_messages_chat_id_index", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_messages_created_at_index": { + "name": "chat_messages_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_messages_creator_id_index": { + "name": "chat_messages_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_messages_parent_message_id_index": { + "name": "chat_messages_parent_message_id_index", + "columns": [ + { + "expression": "parent_message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_messages_chat_id_chats_id_fk": { + "name": "chat_messages_chat_id_chats_id_fk", + "tableFrom": "chat_messages", + "tableTo": "chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "chat_messages_creator_id_users_id_fk": { + "name": "chat_messages_creator_id_users_id_fk", + "tableFrom": "chat_messages", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "chat_messages_parent_message_id_chat_messages_id_fk": { + "name": "chat_messages_parent_message_id_chat_messages_id_fk", + "tableFrom": "chat_messages", + "tableTo": "chat_messages", + "columnsFrom": ["parent_message_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chats": { + "name": "chats", + "schema": "", + "columns": { + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "chats_creator_id_index": { + "name": "chats_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chats_name_index": { + "name": "chats_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chats_organization_id_index": { + "name": "chats_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chats_updater_id_index": { + "name": "chats_updater_id_index", + "columns": [ + { + "expression": "updater_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chats_creator_id_users_id_fk": { + "name": "chats_creator_id_users_id_fk", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "chats_organization_id_organizations_id_fk": { + "name": "chats_organization_id_organizations_id_fk", + "tableFrom": "chats", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "chats_updater_id_users_id_fk": { + "name": "chats_updater_id_users_id_fk", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "chats_name_unique": { + "name": "chats_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.comment_votes": { + "name": "comment_votes", + "schema": "", + "columns": { + "comment_id": { + "name": "comment_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "comment_votes_comment_id_index": { + "name": "comment_votes_comment_id_index", + "columns": [ + { + "expression": "comment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "comment_votes_creator_id_index": { + "name": "comment_votes_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "comment_votes_type_index": { + "name": "comment_votes_type_index", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "comment_votes_comment_id_creator_id_index": { + "name": "comment_votes_comment_id_creator_id_index", + "columns": [ + { + "expression": "comment_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "comment_votes_comment_id_comments_id_fk": { + "name": "comment_votes_comment_id_comments_id_fk", + "tableFrom": "comment_votes", + "tableTo": "comments", + "columnsFrom": ["comment_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "comment_votes_creator_id_users_id_fk": { + "name": "comment_votes_creator_id_users_id_fk", + "tableFrom": "comment_votes", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.comments": { + "name": "comments", + "schema": "", + "columns": { + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "post_id": { + "name": "post_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "comments_created_at_index": { + "name": "comments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "comments_creator_id_index": { + "name": "comments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "comments_post_id_index": { + "name": "comments_post_id_index", + "columns": [ + { + "expression": "post_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "comments_creator_id_users_id_fk": { + "name": "comments_creator_id_users_id_fk", + "tableFrom": "comments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "comments_post_id_posts_id_fk": { + "name": "comments_post_id_posts_id_fk", + "tableFrom": "comments", + "tableTo": "posts", + "columnsFrom": ["post_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.communities": { + "name": "communities", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "facebook_url": { + "name": "facebook_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github_url": { + "name": "github_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "inactivity_timeout_duration": { + "name": "inactivity_timeout_duration", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "instagram_url": { + "name": "instagram_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "linkedin_url": { + "name": "linkedin_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo_mime_type": { + "name": "logo_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo_name": { + "name": "logo_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reddit_url": { + "name": "reddit_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slack_url": { + "name": "slack_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "website_url": { + "name": "website_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "x_url": { + "name": "x_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_url": { + "name": "youtube_url", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "communities_updater_id_users_id_fk": { + "name": "communities_updater_id_users_id_fk", + "tableFrom": "communities", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "communities_name_unique": { + "name": "communities_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.event_attachments": { + "name": "event_attachments", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "event_attachments_event_id_index": { + "name": "event_attachments_event_id_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attachments_created_at_index": { + "name": "event_attachments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attachments_creator_id_index": { + "name": "event_attachments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "event_attachments_creator_id_users_id_fk": { + "name": "event_attachments_creator_id_users_id_fk", + "tableFrom": "event_attachments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "event_attachments_event_id_events_id_fk": { + "name": "event_attachments_event_id_events_id_fk", + "tableFrom": "event_attachments", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "event_attachments_updater_id_users_id_fk": { + "name": "event_attachments_updater_id_users_id_fk", + "tableFrom": "event_attachments", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.event_attendances": { + "name": "event_attendances", + "schema": "", + "columns": { + "attendee_id": { + "name": "attendee_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "check_in_at": { + "name": "check_in_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "check_out_at": { + "name": "check_out_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "event_attendances_attendee_id_index": { + "name": "event_attendances_attendee_id_index", + "columns": [ + { + "expression": "attendee_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attendances_check_in_at_index": { + "name": "event_attendances_check_in_at_index", + "columns": [ + { + "expression": "check_in_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attendances_check_out_at_index": { + "name": "event_attendances_check_out_at_index", + "columns": [ + { + "expression": "check_out_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attendances_created_at_index": { + "name": "event_attendances_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attendances_creator_id_index": { + "name": "event_attendances_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "event_attendances_event_id_index": { + "name": "event_attendances_event_id_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "event_attendances_attendee_id_users_id_fk": { + "name": "event_attendances_attendee_id_users_id_fk", + "tableFrom": "event_attendances", + "tableTo": "users", + "columnsFrom": ["attendee_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "event_attendances_creator_id_users_id_fk": { + "name": "event_attendances_creator_id_users_id_fk", + "tableFrom": "event_attendances", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "event_attendances_event_id_events_id_fk": { + "name": "event_attendances_event_id_events_id_fk", + "tableFrom": "event_attendances", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "event_attendances_updater_id_users_id_fk": { + "name": "event_attendances_updater_id_users_id_fk", + "tableFrom": "event_attendances", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.events": { + "name": "events", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "end_at": { + "name": "end_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "start_at": { + "name": "start_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "events_created_at_index": { + "name": "events_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "events_creator_id_index": { + "name": "events_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "events_end_at_index": { + "name": "events_end_at_index", + "columns": [ + { + "expression": "end_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "events_name_index": { + "name": "events_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "events_organization_id_index": { + "name": "events_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "events_start_at_index": { + "name": "events_start_at_index", + "columns": [ + { + "expression": "start_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "events_creator_id_users_id_fk": { + "name": "events_creator_id_users_id_fk", + "tableFrom": "events", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "events_organization_id_organizations_id_fk": { + "name": "events_organization_id_organizations_id_fk", + "tableFrom": "events", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "events_updater_id_users_id_fk": { + "name": "events_updater_id_users_id_fk", + "tableFrom": "events", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.families": { + "name": "families", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "families_created_at_index": { + "name": "families_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "families_creator_id_index": { + "name": "families_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "families_name_index": { + "name": "families_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "families_organization_id_index": { + "name": "families_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "families_name_organization_id_index": { + "name": "families_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "families_creator_id_users_id_fk": { + "name": "families_creator_id_users_id_fk", + "tableFrom": "families", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "families_organization_id_organizations_id_fk": { + "name": "families_organization_id_organizations_id_fk", + "tableFrom": "families", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "families_updater_id_users_id_fk": { + "name": "families_updater_id_users_id_fk", + "tableFrom": "families", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.family_memberships": { + "name": "family_memberships", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "family_id": { + "name": "family_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "family_memberships_created_at_index": { + "name": "family_memberships_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "family_memberships_creator_id_index": { + "name": "family_memberships_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "family_memberships_family_id_index": { + "name": "family_memberships_family_id_index", + "columns": [ + { + "expression": "family_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "family_memberships_member_id_index": { + "name": "family_memberships_member_id_index", + "columns": [ + { + "expression": "member_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "family_memberships_creator_id_users_id_fk": { + "name": "family_memberships_creator_id_users_id_fk", + "tableFrom": "family_memberships", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "family_memberships_family_id_families_id_fk": { + "name": "family_memberships_family_id_families_id_fk", + "tableFrom": "family_memberships", + "tableTo": "families", + "columnsFrom": ["family_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "family_memberships_member_id_users_id_fk": { + "name": "family_memberships_member_id_users_id_fk", + "tableFrom": "family_memberships", + "tableTo": "users", + "columnsFrom": ["member_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "family_memberships_updater_id_users_id_fk": { + "name": "family_memberships_updater_id_users_id_fk", + "tableFrom": "family_memberships", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "family_memberships_family_id_member_id_pk": { + "name": "family_memberships_family_id_member_id_pk", + "columns": ["family_id", "member_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.fund_campaign_pledges": { + "name": "fund_campaign_pledges", + "schema": "", + "columns": { + "amount": { + "name": "amount", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "campaign_id": { + "name": "campaign_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "pledger_id": { + "name": "pledger_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "fund_campaign_pledges_campaign_id_index": { + "name": "fund_campaign_pledges_campaign_id_index", + "columns": [ + { + "expression": "campaign_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaign_pledges_created_at_index": { + "name": "fund_campaign_pledges_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaign_pledges_creator_id_index": { + "name": "fund_campaign_pledges_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaign_pledges_pledger_id_index": { + "name": "fund_campaign_pledges_pledger_id_index", + "columns": [ + { + "expression": "pledger_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaign_pledges_campaign_id_pledger_id_index": { + "name": "fund_campaign_pledges_campaign_id_pledger_id_index", + "columns": [ + { + "expression": "campaign_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "pledger_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "fund_campaign_pledges_campaign_id_fund_campaigns_id_fk": { + "name": "fund_campaign_pledges_campaign_id_fund_campaigns_id_fk", + "tableFrom": "fund_campaign_pledges", + "tableTo": "fund_campaigns", + "columnsFrom": ["campaign_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "fund_campaign_pledges_creator_id_users_id_fk": { + "name": "fund_campaign_pledges_creator_id_users_id_fk", + "tableFrom": "fund_campaign_pledges", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "fund_campaign_pledges_pledger_id_users_id_fk": { + "name": "fund_campaign_pledges_pledger_id_users_id_fk", + "tableFrom": "fund_campaign_pledges", + "tableTo": "users", + "columnsFrom": ["pledger_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "fund_campaign_pledges_updater_id_users_id_fk": { + "name": "fund_campaign_pledges_updater_id_users_id_fk", + "tableFrom": "fund_campaign_pledges", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.fund_campaigns": { + "name": "fund_campaigns", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "currency_code": { + "name": "currency_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "end_at": { + "name": "end_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "fund_id": { + "name": "fund_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "goal_amount": { + "name": "goal_amount", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "start_at": { + "name": "start_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "fund_campaigns_created_at_index": { + "name": "fund_campaigns_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_creator_id_index": { + "name": "fund_campaigns_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_end_at_index": { + "name": "fund_campaigns_end_at_index", + "columns": [ + { + "expression": "end_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_fund_id_index": { + "name": "fund_campaigns_fund_id_index", + "columns": [ + { + "expression": "fund_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_name_index": { + "name": "fund_campaigns_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_start_at_index": { + "name": "fund_campaigns_start_at_index", + "columns": [ + { + "expression": "start_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "fund_campaigns_fund_id_name_index": { + "name": "fund_campaigns_fund_id_name_index", + "columns": [ + { + "expression": "fund_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "fund_campaigns_creator_id_users_id_fk": { + "name": "fund_campaigns_creator_id_users_id_fk", + "tableFrom": "fund_campaigns", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "fund_campaigns_fund_id_funds_id_fk": { + "name": "fund_campaigns_fund_id_funds_id_fk", + "tableFrom": "fund_campaigns", + "tableTo": "funds", + "columnsFrom": ["fund_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "fund_campaigns_updater_id_users_id_fk": { + "name": "fund_campaigns_updater_id_users_id_fk", + "tableFrom": "fund_campaigns", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funds": { + "name": "funds", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_tax_deductible": { + "name": "is_tax_deductible", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "funds_created_at_index": { + "name": "funds_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "funds_creator_id_index": { + "name": "funds_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "funds_name_index": { + "name": "funds_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "funds_organization_id_index": { + "name": "funds_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "funds_name_organization_id_index": { + "name": "funds_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "funds_creator_id_users_id_fk": { + "name": "funds_creator_id_users_id_fk", + "tableFrom": "funds", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "funds_organization_id_organizations_id_fk": { + "name": "funds_organization_id_organizations_id_fk", + "tableFrom": "funds", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "funds_updater_id_users_id_fk": { + "name": "funds_updater_id_users_id_fk", + "tableFrom": "funds", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization_memberships": { + "name": "organization_memberships", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "organization_memberships_created_at_index": { + "name": "organization_memberships_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organization_memberships_creator_id_index": { + "name": "organization_memberships_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organization_memberships_member_id_index": { + "name": "organization_memberships_member_id_index", + "columns": [ + { + "expression": "member_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organization_memberships_organization_id_index": { + "name": "organization_memberships_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organization_memberships_role_index": { + "name": "organization_memberships_role_index", + "columns": [ + { + "expression": "role", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_memberships_creator_id_users_id_fk": { + "name": "organization_memberships_creator_id_users_id_fk", + "tableFrom": "organization_memberships", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "organization_memberships_member_id_users_id_fk": { + "name": "organization_memberships_member_id_users_id_fk", + "tableFrom": "organization_memberships", + "tableTo": "users", + "columnsFrom": ["member_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "organization_memberships_organization_id_organizations_id_fk": { + "name": "organization_memberships_organization_id_organizations_id_fk", + "tableFrom": "organization_memberships", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "organization_memberships_updater_id_users_id_fk": { + "name": "organization_memberships_updater_id_users_id_fk", + "tableFrom": "organization_memberships", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "organization_memberships_member_id_organization_id_pk": { + "name": "organization_memberships_member_id_organization_id_pk", + "columns": ["member_id", "organization_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organizations": { + "name": "organizations", + "schema": "", + "columns": { + "address_line_1": { + "name": "address_line_1", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "address_line_2": { + "name": "address_line_2", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "city": { + "name": "city", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "country_code": { + "name": "country_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postal_code": { + "name": "postal_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "organizations_creator_id_index": { + "name": "organizations_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organizations_name_index": { + "name": "organizations_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "organizations_updater_id_index": { + "name": "organizations_updater_id_index", + "columns": [ + { + "expression": "updater_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organizations_creator_id_users_id_fk": { + "name": "organizations_creator_id_users_id_fk", + "tableFrom": "organizations", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "organizations_updater_id_users_id_fk": { + "name": "organizations_updater_id_users_id_fk", + "tableFrom": "organizations", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organizations_name_unique": { + "name": "organizations_name_unique", + "nullsNotDistinct": false, + "columns": ["name"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.post_attachments": { + "name": "post_attachments", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "post_id": { + "name": "post_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "post_attachments_created_at_index": { + "name": "post_attachments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "post_attachments_creator_id_index": { + "name": "post_attachments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "post_attachments_post_id_index": { + "name": "post_attachments_post_id_index", + "columns": [ + { + "expression": "post_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "post_attachments_creator_id_users_id_fk": { + "name": "post_attachments_creator_id_users_id_fk", + "tableFrom": "post_attachments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "post_attachments_post_id_posts_id_fk": { + "name": "post_attachments_post_id_posts_id_fk", + "tableFrom": "post_attachments", + "tableTo": "posts", + "columnsFrom": ["post_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "post_attachments_updater_id_users_id_fk": { + "name": "post_attachments_updater_id_users_id_fk", + "tableFrom": "post_attachments", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.post_votes": { + "name": "post_votes", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "post_id": { + "name": "post_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "post_votes_creator_id_index": { + "name": "post_votes_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "post_votes_post_id_index": { + "name": "post_votes_post_id_index", + "columns": [ + { + "expression": "post_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "post_votes_type_index": { + "name": "post_votes_type_index", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "post_votes_creator_id_post_id_index": { + "name": "post_votes_creator_id_post_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "post_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "post_votes_creator_id_users_id_fk": { + "name": "post_votes_creator_id_users_id_fk", + "tableFrom": "post_votes", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "post_votes_post_id_posts_id_fk": { + "name": "post_votes_post_id_posts_id_fk", + "tableFrom": "post_votes", + "tableTo": "posts", + "columnsFrom": ["post_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.posts": { + "name": "posts", + "schema": "", + "columns": { + "caption": { + "name": "caption", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "pinned_at": { + "name": "pinned_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "posts_created_at_index": { + "name": "posts_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "posts_creator_id_index": { + "name": "posts_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "posts_pinned_at_index": { + "name": "posts_pinned_at_index", + "columns": [ + { + "expression": "pinned_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "posts_organization_id_index": { + "name": "posts_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "posts_creator_id_users_id_fk": { + "name": "posts_creator_id_users_id_fk", + "tableFrom": "posts", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "posts_organization_id_organizations_id_fk": { + "name": "posts_organization_id_organizations_id_fk", + "tableFrom": "posts", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "posts_updater_id_users_id_fk": { + "name": "posts_updater_id_users_id_fk", + "tableFrom": "posts", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tag_assignments": { + "name": "tag_assignments", + "schema": "", + "columns": { + "assignee_id": { + "name": "assignee_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "tag_id": { + "name": "tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "tag_assignments_assignee_id_index": { + "name": "tag_assignments_assignee_id_index", + "columns": [ + { + "expression": "assignee_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_assignments_created_at_index": { + "name": "tag_assignments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_assignments_creator_id_index": { + "name": "tag_assignments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_assignments_tag_id_index": { + "name": "tag_assignments_tag_id_index", + "columns": [ + { + "expression": "tag_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tag_assignments_assignee_id_users_id_fk": { + "name": "tag_assignments_assignee_id_users_id_fk", + "tableFrom": "tag_assignments", + "tableTo": "users", + "columnsFrom": ["assignee_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "tag_assignments_creator_id_users_id_fk": { + "name": "tag_assignments_creator_id_users_id_fk", + "tableFrom": "tag_assignments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "tag_assignments_tag_id_tags_id_fk": { + "name": "tag_assignments_tag_id_tags_id_fk", + "tableFrom": "tag_assignments", + "tableTo": "tags", + "columnsFrom": ["tag_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "tag_assignments_assignee_id_tag_id_pk": { + "name": "tag_assignments_assignee_id_tag_id_pk", + "columns": ["assignee_id", "tag_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tag_folders": { + "name": "tag_folders", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "parent_folder_id": { + "name": "parent_folder_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tag_folders_created_at_index": { + "name": "tag_folders_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_folders_creator_id_index": { + "name": "tag_folders_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_folders_name_index": { + "name": "tag_folders_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_folders_organization_id_index": { + "name": "tag_folders_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tag_folders_parent_folder_id_index": { + "name": "tag_folders_parent_folder_id_index", + "columns": [ + { + "expression": "parent_folder_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tag_folders_creator_id_users_id_fk": { + "name": "tag_folders_creator_id_users_id_fk", + "tableFrom": "tag_folders", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "tag_folders_organization_id_organizations_id_fk": { + "name": "tag_folders_organization_id_organizations_id_fk", + "tableFrom": "tag_folders", + "tableTo": "", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "tag_folders_parent_folder_id_tag_folders_id_fk": { + "name": "tag_folders_parent_folder_id_tag_folders_id_fk", + "tableFrom": "tag_folders", + "tableTo": "tag_folders", + "columnsFrom": ["parent_folder_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "tag_folders_updater_id_users_id_fk": { + "name": "tag_folders_updater_id_users_id_fk", + "tableFrom": "tag_folders", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tags": { + "name": "tags", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "folder_id": { + "name": "folder_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tags_creator_id_index": { + "name": "tags_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tags_name_index": { + "name": "tags_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tags_organization_id_index": { + "name": "tags_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "tags_name_organization_id_index": { + "name": "tags_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tags_creator_id_users_id_fk": { + "name": "tags_creator_id_users_id_fk", + "tableFrom": "tags", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "tags_folder_id_tag_folders_id_fk": { + "name": "tags_folder_id_tag_folders_id_fk", + "tableFrom": "tags", + "tableTo": "tag_folders", + "columnsFrom": ["folder_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "tags_organization_id_organizations_id_fk": { + "name": "tags_organization_id_organizations_id_fk", + "tableFrom": "tags", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "tags_updater_id_users_id_fk": { + "name": "tags_updater_id_users_id_fk", + "tableFrom": "tags", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "address_line_1": { + "name": "address_line_1", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "address_line_2": { + "name": "address_line_2", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "birth_date": { + "name": "birth_date", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "city": { + "name": "city", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "country_code": { + "name": "country_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "education_grade": { + "name": "education_grade", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email_address": { + "name": "email_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "employment_status": { + "name": "employment_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "home_phone_number": { + "name": "home_phone_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_email_address_verified": { + "name": "is_email_address_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "marital_status": { + "name": "marital_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mobile_phone_number": { + "name": "mobile_phone_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "natal_sex": { + "name": "natal_sex", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "natural_language_code": { + "name": "natural_language_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password_hash": { + "name": "password_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postal_code": { + "name": "postal_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "work_phone_number": { + "name": "work_phone_number", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "users_creator_id_index": { + "name": "users_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_name_index": { + "name": "users_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_updater_id_index": { + "name": "users_updater_id_index", + "columns": [ + { + "expression": "updater_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "users_creator_id_users_id_fk": { + "name": "users_creator_id_users_id_fk", + "tableFrom": "users", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "users_updater_id_users_id_fk": { + "name": "users_updater_id_users_id_fk", + "tableFrom": "users", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_address_unique": { + "name": "users_email_address_unique", + "nullsNotDistinct": false, + "columns": ["email_address"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.venue_attachments": { + "name": "venue_attachments", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "venue_id": { + "name": "venue_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "venue_attachments_created_at_index": { + "name": "venue_attachments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venue_attachments_creator_id_index": { + "name": "venue_attachments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venue_attachments_venue_id_index": { + "name": "venue_attachments_venue_id_index", + "columns": [ + { + "expression": "venue_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "venue_attachments_creator_id_users_id_fk": { + "name": "venue_attachments_creator_id_users_id_fk", + "tableFrom": "venue_attachments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "venue_attachments_updater_id_users_id_fk": { + "name": "venue_attachments_updater_id_users_id_fk", + "tableFrom": "venue_attachments", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "venue_attachments_venue_id_venues_id_fk": { + "name": "venue_attachments_venue_id_venues_id_fk", + "tableFrom": "venue_attachments", + "tableTo": "venues", + "columnsFrom": ["venue_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.venue_bookings": { + "name": "venue_bookings", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "venue_id": { + "name": "venue_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "venue_bookings_created_at_index": { + "name": "venue_bookings_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venue_bookings_creator_id_index": { + "name": "venue_bookings_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venue_bookings_event_id_index": { + "name": "venue_bookings_event_id_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venue_bookings_venue_id_index": { + "name": "venue_bookings_venue_id_index", + "columns": [ + { + "expression": "venue_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "venue_bookings_creator_id_users_id_fk": { + "name": "venue_bookings_creator_id_users_id_fk", + "tableFrom": "venue_bookings", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "venue_bookings_event_id_events_id_fk": { + "name": "venue_bookings_event_id_events_id_fk", + "tableFrom": "venue_bookings", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "venue_bookings_venue_id_venues_id_fk": { + "name": "venue_bookings_venue_id_venues_id_fk", + "tableFrom": "venue_bookings", + "tableTo": "venues", + "columnsFrom": ["venue_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "venue_bookings_event_id_venue_id_pk": { + "name": "venue_bookings_event_id_venue_id_pk", + "columns": ["event_id", "venue_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.venues": { + "name": "venues", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "venues_created_at_index": { + "name": "venues_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venues_creator_id_index": { + "name": "venues_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venues_name_index": { + "name": "venues_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venues_organization_id_index": { + "name": "venues_organization_id_index", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "venues_name_organization_id_index": { + "name": "venues_name_organization_id_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "venues_creator_id_users_id_fk": { + "name": "venues_creator_id_users_id_fk", + "tableFrom": "venues", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "venues_organization_id_organizations_id_fk": { + "name": "venues_organization_id_organizations_id_fk", + "tableFrom": "venues", + "tableTo": "organizations", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "venues_updater_id_users_id_fk": { + "name": "venues_updater_id_users_id_fk", + "tableFrom": "venues", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.volunteer_group_assignments": { + "name": "volunteer_group_assignments", + "schema": "", + "columns": { + "assignee_id": { + "name": "assignee_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "group_id": { + "name": "group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "invite_status": { + "name": "invite_status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "volunteer_group_assignments_created_at_index": { + "name": "volunteer_group_assignments_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_group_assignments_creator_id_index": { + "name": "volunteer_group_assignments_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_group_assignments_group_id_index": { + "name": "volunteer_group_assignments_group_id_index", + "columns": [ + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "volunteer_group_assignments_assignee_id_users_id_fk": { + "name": "volunteer_group_assignments_assignee_id_users_id_fk", + "tableFrom": "volunteer_group_assignments", + "tableTo": "users", + "columnsFrom": ["assignee_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "volunteer_group_assignments_creator_id_users_id_fk": { + "name": "volunteer_group_assignments_creator_id_users_id_fk", + "tableFrom": "volunteer_group_assignments", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "volunteer_group_assignments_group_id_volunteer_groups_id_fk": { + "name": "volunteer_group_assignments_group_id_volunteer_groups_id_fk", + "tableFrom": "volunteer_group_assignments", + "tableTo": "volunteer_groups", + "columnsFrom": ["group_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "volunteer_group_assignments_updater_id_users_id_fk": { + "name": "volunteer_group_assignments_updater_id_users_id_fk", + "tableFrom": "volunteer_group_assignments", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "volunteer_group_assignments_assignee_id_group_id_pk": { + "name": "volunteer_group_assignments_assignee_id_group_id_pk", + "columns": ["assignee_id", "group_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.volunteer_groups": { + "name": "volunteer_groups", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "event_id": { + "name": "event_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "leader_id": { + "name": "leader_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "max_volunteer_count": { + "name": "max_volunteer_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updater_id": { + "name": "updater_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "volunteer_groups_created_at_index": { + "name": "volunteer_groups_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_groups_creator_id_index": { + "name": "volunteer_groups_creator_id_index", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_groups_event_id_index": { + "name": "volunteer_groups_event_id_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_groups_leader_id_index": { + "name": "volunteer_groups_leader_id_index", + "columns": [ + { + "expression": "leader_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_groups_name_index": { + "name": "volunteer_groups_name_index", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "volunteer_groups_event_id_name_index": { + "name": "volunteer_groups_event_id_name_index", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "volunteer_groups_creator_id_users_id_fk": { + "name": "volunteer_groups_creator_id_users_id_fk", + "tableFrom": "volunteer_groups", + "tableTo": "users", + "columnsFrom": ["creator_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "volunteer_groups_event_id_events_id_fk": { + "name": "volunteer_groups_event_id_events_id_fk", + "tableFrom": "volunteer_groups", + "tableTo": "events", + "columnsFrom": ["event_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "volunteer_groups_leader_id_users_id_fk": { + "name": "volunteer_groups_leader_id_users_id_fk", + "tableFrom": "volunteer_groups", + "tableTo": "users", + "columnsFrom": ["leader_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + }, + "volunteer_groups_updater_id_users_id_fk": { + "name": "volunteer_groups_updater_id_users_id_fk", + "tableFrom": "volunteer_groups", + "tableTo": "users", + "columnsFrom": ["updater_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/src/drizzle/tables/organizations.ts b/src/drizzle/tables/organizations.ts index 5f3f76d2544..e46dc9293ee 100755 --- a/src/drizzle/tables/organizations.ts +++ b/src/drizzle/tables/organizations.ts @@ -211,6 +211,7 @@ export const organizationsTableRelations = relations( export const organizationsTableInsertSchema = createInsertSchema( organizationsTable, { + id: (schema) => schema.optional(), addressLine1: (schema) => schema.min(1).max(1024).optional(), addressLine2: (schema) => schema.min(1).max(1024).optional(), avatarName: (schema) => schema.min(1).optional(), diff --git a/src/plugins/seedInitialData.ts b/src/plugins/seedInitialData.ts index 8b134ef6b40..429b0523e8d 100644 --- a/src/plugins/seedInitialData.ts +++ b/src/plugins/seedInitialData.ts @@ -1,5 +1,5 @@ import { hash } from "@node-rs/argon2"; -import { eq } from "drizzle-orm"; +import { and, eq, isNotNull, sql } from "drizzle-orm"; import type { FastifyPluginAsync } from "fastify"; import fastifyPlugin from "fastify-plugin"; import { uuidv7 } from "uuidv7"; @@ -8,6 +8,11 @@ import { communitiesTable, communitiesTableInsertSchema, } from "~/src/drizzle/tables/communities"; +import { organizationMembershipsTable } from "~/src/drizzle/tables/organizationMemberships"; +import { + organizationsTable, + organizationsTableInsertSchema, +} from "~/src/drizzle/tables/organizations"; import { usersTable, usersTableInsertSchema } from "~/src/drizzle/tables/users"; /** @@ -174,6 +179,88 @@ const plugin: FastifyPluginAsync = async (fastify) => { fastify.log.info("Successfully created the community in the database."); } + + fastify.log.info("Checking if an organization with a valid address exists."); + + try { + const organizationExists = await fastify.drizzleClient + .select({ addressLine1: organizationsTable.addressLine1 }) + .from(organizationsTable) + .where( + and( + isNotNull(organizationsTable.addressLine1), + sql`char_length(${organizationsTable.addressLine1}) > 0`, + ), + ) + + .limit(1) + .then((result) => result.length > 0); + + if (organizationExists) { + fastify.log.info( + "Organization with a valid address already exists. Skipping creation.", + ); + return; + } + + fastify.log.info( + "Creating default organization as no valid address was found.", + ); + + const adminUser = await fastify.drizzleClient.query.usersTable.findFirst({ + columns: { id: true }, + where: (fields, operators) => + operators.eq( + fields.emailAddress, + fastify.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, + ), + }); + + if (!adminUser) { + throw new Error("API Administrator user not found."); + } + + await fastify.drizzleClient.transaction(async (tx) => { + const organizationId = uuidv7(); + + const defaultOrganization = organizationsTableInsertSchema.parse({ + id: organizationId, + name: "Unity Foundation USA", + description: "Service to the Community", + addressLine1: "1268 Finwood Road", + addressLine2: "Suite 200", + city: "Dodge City", + postalCode: "67801", + state: "Kansas", + avatarName: null, + countryCode: "us", + createdAt: new Date(), + creatorId: adminUser.id, + }); + + await tx.insert(organizationsTable).values(defaultOrganization); + + await tx.insert(organizationMembershipsTable).values({ + memberId: adminUser.id, + organizationId, + role: "administrator", + creatorId: adminUser.id, + createdAt: new Date(), + }); + + fastify.log.info( + "Default organization and admin membership created successfully.", + ); + }); + } catch (error) { + fastify.log.error( + { err: error }, + "Error while checking or creating organization", + ); + throw new Error("Database operation failed while handling organization.", { + cause: error, + }); + } }; export default fastifyPlugin(plugin, {