paste #8uA
:
+--------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------+
| Column | Type | Modifiers | Storage | Stats target | Description |
|--------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------|
| id | integer | not null default nextval('bookings_id_seq'::regclass) | plain | <null> | <null> |
| employee_id | integer | | plain | <null> | <null> |
| provider_id | integer | | plain | <null> | <null> |
| service_id | integer | | plain | <null> | <null> |
| customer_id | integer | | plain | 10000 | <null> |
| schedule_time | time without time zone | | plain | <null> | <null> |
| schedule_time_end | time without time zone | | plain | <null> | <null> |
| notes | text | | extended | <null> | <null> |
| status | character varying | default 'unconfirmed'::character varying | extended | <null> | <null> |
| booking_type | character varying | not null | extended | <null> | <null> |
| reference | character varying | | extended | <null> | <null> |
| created_at | timestamp without time zone | | plain | <null> | <null> |
| updated_at | timestamp without time zone | | plain | <null> | <null> |
| service_pricing_level_id | integer | | plain | <null> | <null> |
| location_id | integer | | plain | <null> | <null> |
| price | numeric(12,2) | | main | <null> | <null> |
| deleted_at | timestamp without time zone | | plain | <null> | <null> |
| created_by_employee_id | integer | | plain | <null> | <null> |
| parent_id | integer | | plain | <null> | <null> |
| time_start_in_seconds | integer | not null default 0 | plain | <null> | <null> |
| time_end_in_seconds | integer | not null default 0 | plain | <null> | <null> |
| date | date | | plain | <null> | <null> |
| extra_time_type | character varying | | extended | <null> | <null> |
| extra_time_in_seconds | integer | | plain | <null> | <null> |
| room_id | integer | | plain | <null> | <null> |
| booking_sequence_id | integer | | plain | <null> | <null> |
| cancelled_at | timestamp without time zone | | plain | <null> | <null> |
| cancelled_by_employee_id | integer | | plain | <null> | <null> |
| base_price | numeric(12,2) | default 0.0 | main | <null> | <null> |
| employee_is_requested | boolean | default false | plain | <null> | <null> |
| rebooked | boolean | | plain | <null> | <null> |
| cancellation_reason_id | integer | | plain | <null> | <null> |
| marketplace | boolean | default false | plain | <null> | <null> |
| appointment_id | integer | | plain | <null> | <null> |
| price_type | integer | | plain | <null> | <null> |
| upsold | boolean | | plain | <null> | <null> |
+--------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------+
Indexes:
"bookings_pkey" PRIMARY KEY, btree (id)
"appointment_cancellation_report_index" btree (provider_id, cancellation_reason_id, cancelled_at) WHERE status::text = 'cancelled'::text AND deleted_at IS NULL
"index_bookings_on_appointment_id" btree (appointment_id)
"index_bookings_on_booking_sequence_id" btree (booking_sequence_id)
"index_bookings_on_cancellation_reason_id" btree (cancellation_reason_id)
"index_bookings_on_customer_id" btree (customer_id)
"index_bookings_on_date" btree (date)
"index_bookings_on_employee_id_and_date" btree (employee_id, date)
"index_bookings_on_location_id_and_date_and_employee_id" btree (location_id, date, employee_id)
"index_bookings_on_parent_id" btree (parent_id)
"index_bookings_on_provider_id_and_date" btree (provider_id, date)
"index_bookings_on_provider_id_and_updated_at" btree (provider_id, updated_at)
"index_bookings_on_reference" btree (reference)
"index_bookings_on_room_id" btree (room_id)
"index_bookings_on_service_id" btree (service_id)
"index_bookings_on_service_pricing_level_id" btree (service_pricing_level_id)
"index_bookings_on_status" btree (status)
Check constraints:
"bookings_provider_id_not_null" CHECK (provider_id IS NOT NULL) NOT VALID
+ --------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------+
| COLUMN | TYPE | Modifiers | Storage | Stats target | Description | | --------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------| | id | integer | NOT NULL DEFAULT nextval('bookings_id_seq'::regclass) | plain | < NULL > | < NULL > | | employee_id | integer | | plain | < NULL > | < NULL > | | provider_id | integer | | plain | < NULL > | < NULL > | | service_id | integer | | plain | < NULL > | < NULL > | | customer_id | integer | | plain | 10000 | < NULL > | | schedule_time | time WITHOUT time zone | | plain | < NULL > | < NULL > | | schedule_time_end | time WITHOUT time zone | | plain | < NULL > | < NULL > | | notes | text | | extended | < NULL > | < NULL > | | status | character varying | DEFAULT 'unconfirmed'::character varying | extended | < NULL > | < NULL > | | booking_type | character varying | NOT NULL | extended | < NULL > | < NULL > | | reference | character varying | | extended | < NULL > | < NULL > | | created_at | timestamp WITHOUT time zone | | plain | < NULL > | < NULL > | | updated_at | timestamp WITHOUT time zone | | plain | < NULL > | < NULL > | | service_pricing_level_id | integer | | plain | < NULL > | < NULL > | | location_id | integer | | plain | < NULL > | < NULL > | | price | numeric(12, 2) | | main | < NULL > | < NULL > | | deleted_at | timestamp WITHOUT time zone | | plain | < NULL > | < NULL > | | created_by_employee_id | integer | | plain | < NULL > | < NULL > | | parent_id | integer | | plain | < NULL > | < NULL > | | time_start_in_seconds | integer | NOT NULL DEFAULT 0 | plain | < NULL > | < NULL > | | time_end_in_seconds | integer | NOT NULL DEFAULT 0 | plain | < NULL > | < NULL > | | date | date | | plain | < NULL > | < NULL > | | extra_time_type | character varying | | extended | < NULL > | < NULL > | | extra_time_in_seconds | integer | | plain | < NULL > | < NULL > | | room_id | integer | | plain | < NULL > | < NULL > | | booking_sequence_id | integer | | plain | < NULL > | < NULL > | | cancelled_at | timestamp WITHOUT time zone | | plain | < NULL > | < NULL > | | cancelled_by_employee_id | integer | | plain | < NULL > | < NULL > | | base_price | numeric(12, 2) | DEFAULT 0.0 | main | < NULL > | < NULL > | | employee_is_requested | boolean | DEFAULT FALSE | plain | < NULL > | < NULL > | | rebooked | boolean | | plain | < NULL > | < NULL > | | cancellation_reason_id | integer | | plain | < NULL > | < NULL > | | marketplace | boolean | DEFAULT FALSE | plain | < NULL > | < NULL > | | appointment_id | integer | | plain | < NULL > | < NULL > | | price_type | integer | | plain | < NULL > | < NULL > | | upsold | boolean | | plain | < NULL > | < NULL > | + --------------------------+-----------------------------+--------------------------------------------------------+----------+--------------+-------------+ Indexes: "bookings_pkey" PRIMARY KEY, btree (id) "appointment_cancellation_report_index" btree (provider_id, cancellation_reason_id, cancelled_at)
WHERE
status::text = 'cancelled'::text AND deleted_at IS NULL "index_bookings_on_appointment_id" btree (appointment_id) "index_bookings_on_booking_sequence_id" btree (booking_sequence_id) "index_bookings_on_cancellation_reason_id" btree (cancellation_reason_id) "index_bookings_on_customer_id" btree (customer_id) "index_bookings_on_date" btree (date) "index_bookings_on_employee_id_and_date" btree (employee_id, date) "index_bookings_on_location_id_and_date_and_employee_id" btree (location_id, date, employee_id) "index_bookings_on_parent_id" btree (parent_id) "index_bookings_on_provider_id_and_date" btree (provider_id, date) "index_bookings_on_provider_id_and_updated_at" btree (provider_id, updated_at) "index_bookings_on_reference" btree (reference) "index_bookings_on_room_id" btree (room_id) "index_bookings_on_service_id" btree (service_id) "index_bookings_on_service_pricing_level_id" btree (service_pricing_level_id) "index_bookings_on_status" btree (status) CHECK constraints: "bookings_provider_id_not_null" CHECK (provider_id IS NOT NULL) NOT VALID
-- Formatted by pgFormatter::Beautify