From f8f130e2f8060851886cfe9b9c50b1ebba0b5728 Mon Sep 17 00:00:00 2001 From: ItsMalma Date: Sun, 30 Nov 2025 10:28:36 +0700 Subject: [PATCH] restart migration --- .../migrations/.snapshot-goumrah.json | 11379 ++++++++-------- .../migrations/Migration20251104110158.ts | 367 - .../migrations/Migration20251108053920.ts | 91 - .../migrations/Migration20251110080126.ts | 226 - .../migrations/Migration20251111010042.ts | 133 - .../migrations/Migration20251112104244.ts | 27 - .../migrations/Migration20251112105017.ts | 35 - .../migrations/Migration20251112105413.ts | 35 - .../migrations/Migration20251112134446.ts | 47 - .../migrations/Migration20251112140208.ts | 29 - .../migrations/Migration20251113230544.ts | 283 - .../migrations/Migration20251119103455.ts | 184 - .../migrations/Migration20251130032813.ts | 490 + 13 files changed, 6469 insertions(+), 6857 deletions(-) delete mode 100644 src/database/migrations/Migration20251104110158.ts delete mode 100644 src/database/migrations/Migration20251108053920.ts delete mode 100644 src/database/migrations/Migration20251110080126.ts delete mode 100644 src/database/migrations/Migration20251111010042.ts delete mode 100644 src/database/migrations/Migration20251112104244.ts delete mode 100644 src/database/migrations/Migration20251112105017.ts delete mode 100644 src/database/migrations/Migration20251112105413.ts delete mode 100644 src/database/migrations/Migration20251112134446.ts delete mode 100644 src/database/migrations/Migration20251112140208.ts delete mode 100644 src/database/migrations/Migration20251113230544.ts delete mode 100644 src/database/migrations/Migration20251119103455.ts create mode 100644 src/database/migrations/Migration20251130032813.ts diff --git a/src/database/migrations/.snapshot-goumrah.json b/src/database/migrations/.snapshot-goumrah.json index 873b77e..d45ceb7 100644 --- a/src/database/migrations/.snapshot-goumrah.json +++ b/src/database/migrations/.snapshot-goumrah.json @@ -1,5402 +1,5981 @@ { - "namespaces": ["public"], - "name": "public", - "tables": [ - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "code": { - "name": "code", - "type": "varchar(10)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 10, - "mappedType": "string" - }, - "logo": { - "name": "logo", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "skytrax_rating": { - "name": "skytrax_rating", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "skytrax_type": { - "name": "skytrax_type", - "type": "skytrax_type", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "skytrax_type", - "enumItems": ["full_service", "low_cost"], - "mappedType": "enum" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "airline", - "schema": "public", - "indexes": [ - { - "columnNames": ["code"], - "composite": false, - "keyName": "airline_code_unique", - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "airline_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "country", - "schema": "public", - "indexes": [ - { - "keyName": "country_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "country_id": { - "name": "country_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "city", - "schema": "public", - "indexes": [ - { - "keyName": "city_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "city_country_id_foreign": { - "constraintName": "city_country_id_foreign", - "columnNames": ["country_id"], - "localTableName": "public.city", - "referencedColumnNames": ["id"], - "referencedTableName": "public.country", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "code": { - "name": "code", - "type": "varchar(10)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 10, - "mappedType": "string" - }, - "city_id": { - "name": "city_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "airport", - "schema": "public", - "indexes": [ - { - "columnNames": ["code"], - "composite": false, - "keyName": "airport_code_unique", - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "airport_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "airport_city_id_foreign": { - "constraintName": "airport_city_id_foreign", - "columnNames": ["city_id"], - "localTableName": "public.airport", - "referencedColumnNames": ["id"], - "referencedTableName": "public.city", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "airline_id": { - "name": "airline_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "number": { - "name": "number", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "departure_airport_id": { - "name": "departure_airport_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "departure_terminal": { - "name": "departure_terminal", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "departure_gate": { - "name": "departure_gate", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "departure_time": { - "name": "departure_time", - "type": "time(0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 0, - "mappedType": "time" - }, - "arrival_airport_id": { - "name": "arrival_airport_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "arrival_terminal": { - "name": "arrival_terminal", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "arrival_gate": { - "name": "arrival_gate", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "duration": { - "name": "duration", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "aircraft": { - "name": "aircraft", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "flight", - "schema": "public", - "indexes": [ - { - "keyName": "flight_airline_id_number_unique", - "columnNames": ["airline_id", "number"], - "composite": true, - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "flight_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "flight_airline_id_foreign": { - "constraintName": "flight_airline_id_foreign", - "columnNames": ["airline_id"], - "localTableName": "public.flight", - "referencedColumnNames": ["id"], - "referencedTableName": "public.airline", - "updateRule": "cascade" - }, - "flight_departure_airport_id_foreign": { - "constraintName": "flight_departure_airport_id_foreign", - "columnNames": ["departure_airport_id"], - "localTableName": "public.flight", - "referencedColumnNames": ["id"], - "referencedTableName": "public.airport", - "updateRule": "cascade" - }, - "flight_arrival_airport_id_foreign": { - "constraintName": "flight_arrival_airport_id_foreign", - "columnNames": ["arrival_airport_id"], - "localTableName": "public.flight", - "referencedColumnNames": ["id"], - "referencedTableName": "public.airport", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "flight_id": { - "name": "flight_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "class": { - "name": "class", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "seat_layout": { - "name": "seat_layout", - "type": "varchar(10)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 10, - "mappedType": "string" - }, - "baggage": { - "name": "baggage", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "cabin_baggage": { - "name": "cabin_baggage", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "flight_class", - "schema": "public", - "indexes": [ - { - "keyName": "flight_class_flight_id_class_unique", - "columnNames": ["flight_id", "class"], - "composite": true, - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "flight_class_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "flight_class_flight_id_foreign": { - "constraintName": "flight_class_flight_id_foreign", - "columnNames": ["flight_id"], - "localTableName": "public.flight_class", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "flight_id": { - "name": "flight_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "next_id": { - "name": "next_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "flight_schedule", - "schema": "public", - "indexes": [ - { - "keyName": "flight_schedule_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "flight_schedule_flight_id_foreign": { - "constraintName": "flight_schedule_flight_id_foreign", - "columnNames": ["flight_id"], - "localTableName": "public.flight_schedule", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight_class", - "updateRule": "cascade" - }, - "flight_schedule_next_id_foreign": { - "constraintName": "flight_schedule_next_id_foreign", - "columnNames": ["next_id"], - "localTableName": "public.flight_schedule", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight_schedule", - "deleteRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "city_id": { - "name": "city_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "star": { - "name": "star", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "google_maps_link": { - "name": "google_maps_link", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 1000, - "mappedType": "string" - }, - "google_maps_embed": { - "name": "google_maps_embed", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 1000, - "mappedType": "string" - }, - "google_reviews_link": { - "name": "google_reviews_link", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 1000, - "mappedType": "string" - }, - "description": { - "name": "description", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 1000, - "mappedType": "string" - }, - "address": { - "name": "address", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "landmark": { - "name": "landmark", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "distance_to_landmark": { - "name": "distance_to_landmark", - "type": "numeric(10,0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "precision": 10, - "scale": 0, - "mappedType": "decimal" - }, - "food_type": { - "name": "food_type", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "food_amount": { - "name": "food_amount", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "food_menu": { - "name": "food_menu", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "hotel", - "schema": "public", - "indexes": [ - { - "keyName": "hotel_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "hotel_city_id_foreign": { - "constraintName": "hotel_city_id_foreign", - "columnNames": ["city_id"], - "localTableName": "public.hotel", - "referencedColumnNames": ["id"], - "referencedTableName": "public.city", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "icon": { - "name": "icon", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "hotel_facility", - "schema": "public", - "indexes": [ - { - "keyName": "hotel_facility_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "hotel_id": { - "name": "hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "hotel_facility_id": { - "name": "hotel_facility_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - } - }, - "name": "hotel_facilities", - "schema": "public", - "indexes": [ - { - "keyName": "hotel_facilities_pkey", - "columnNames": ["hotel_id", "hotel_facility_id"], - "composite": true, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "hotel_facilities_hotel_id_foreign": { - "constraintName": "hotel_facilities_hotel_id_foreign", - "columnNames": ["hotel_id"], - "localTableName": "public.hotel_facilities", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel", - "deleteRule": "cascade", - "updateRule": "cascade" - }, - "hotel_facilities_hotel_facility_id_foreign": { - "constraintName": "hotel_facilities_hotel_facility_id_foreign", - "columnNames": ["hotel_facility_id"], - "localTableName": "public.hotel_facilities", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel_facility", - "deleteRule": "cascade", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "hotel_id": { - "name": "hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "src": { - "name": "src", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "hotel_image", - "schema": "public", - "indexes": [ - { - "keyName": "hotel_image_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "hotel_image_hotel_id_foreign": { - "constraintName": "hotel_image_hotel_id_foreign", - "columnNames": ["hotel_id"], - "localTableName": "public.hotel_image", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "hotel_id": { - "name": "hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "check_in": { - "name": "check_in", - "type": "time(0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 0, - "mappedType": "time" - }, - "check_out": { - "name": "check_out", - "type": "time(0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 0, - "mappedType": "time" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "hotel_schedule", - "schema": "public", - "indexes": [ - { - "keyName": "hotel_schedule_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "hotel_schedule_hotel_id_foreign": { - "constraintName": "hotel_schedule_hotel_id_foreign", - "columnNames": ["hotel_id"], - "localTableName": "public.hotel_schedule", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "type": { - "name": "type", - "type": "package_type", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "package_type", - "enumItems": ["reguler", "plus"], - "mappedType": "enum" - }, - "class": { - "name": "class", - "type": "package_class", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "package_class", - "enumItems": ["silver", "gold", "platinum"], - "mappedType": "enum" - }, - "thumbnail": { - "name": "thumbnail", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "use_fast_train": { - "name": "use_fast_train", - "type": "boolean", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "boolean" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "package", - "schema": "public", - "indexes": [ - { - "keyName": "package_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "title": { - "name": "title", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "description": { - "name": "description", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 1000, - "mappedType": "string" - }, - "next_id": { - "name": "next_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "package_itinerary_day", - "schema": "public", - "indexes": [ - { - "keyName": "package_itinerary_day_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_itinerary_day_next_id_foreign": { - "constraintName": "package_itinerary_day_next_id_foreign", - "columnNames": ["next_id"], - "localTableName": "public.package_itinerary_day", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary_day", - "deleteRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "location": { - "name": "location", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "day_id": { - "name": "day_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "next_id": { - "name": "next_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "package_itinerary", - "schema": "public", - "indexes": [ - { - "keyName": "package_itinerary_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_itinerary_day_id_foreign": { - "constraintName": "package_itinerary_day_id_foreign", - "columnNames": ["day_id"], - "localTableName": "public.package_itinerary", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary_day", - "deleteRule": "cascade" - }, - "package_itinerary_next_id_foreign": { - "constraintName": "package_itinerary_next_id_foreign", - "columnNames": ["next_id"], - "localTableName": "public.package_itinerary", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary", - "deleteRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "package_itinerary_id": { - "name": "package_itinerary_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "src": { - "name": "src", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "package_itinerary_image", - "schema": "public", - "indexes": [ - { - "keyName": "package_itinerary_image_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_itinerary_image_package_itinerary_id_foreign": { - "constraintName": "package_itinerary_image_package_itinerary_id_foreign", - "columnNames": ["package_itinerary_id"], - "localTableName": "public.package_itinerary_image", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "package_itinerary_day_id": { - "name": "package_itinerary_day_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "type": { - "name": "type", - "type": "package_itinerary_widget_type", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "package_itinerary_widget_type", - "enumItems": ["hotel", "information", "transport"], - "mappedType": "enum" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "hotel_id": { - "name": "hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "description": { - "name": "description", - "type": "varchar(1000)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 1000, - "mappedType": "string" - }, - "transportation": { - "name": "transportation", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "from": { - "name": "from", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "to": { - "name": "to", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - } - }, - "name": "package_itinerary_widget", - "schema": "public", - "indexes": [ - { - "columnNames": ["type"], - "composite": false, - "keyName": "package_itinerary_widget_type_index", - "constraint": false, - "primary": false, - "unique": false - }, - { - "keyName": "package_itinerary_widget_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_itinerary_widget_package_itinerary_day_id_foreign": { - "constraintName": "package_itinerary_widget_package_itinerary_day_id_foreign", - "columnNames": ["package_itinerary_day_id"], - "localTableName": "public.package_itinerary_widget", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary_day", - "updateRule": "cascade" - }, - "package_itinerary_widget_hotel_id_foreign": { - "constraintName": "package_itinerary_widget_hotel_id_foreign", - "columnNames": ["hotel_id"], - "localTableName": "public.package_itinerary_widget", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel", - "deleteRule": "set null", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "type": { - "name": "type", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "transportation", - "schema": "public", - "indexes": [ - { - "keyName": "transportation_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "transportation_id": { - "name": "transportation_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "class": { - "name": "class", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "total_seats": { - "name": "total_seats", - "type": "int", - "unsigned": true, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "integer" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "transportation_class", - "schema": "public", - "indexes": [ - { - "keyName": "transportation_class_transportation_id_class_unique", - "columnNames": ["transportation_id", "class"], - "composite": true, - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "transportation_class_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "transportation_class_transportation_id_foreign": { - "constraintName": "transportation_class_transportation_id_foreign", - "columnNames": ["transportation_id"], - "localTableName": "public.transportation_class", - "referencedColumnNames": ["id"], - "referencedTableName": "public.transportation", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "package_id": { - "name": "package_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "departure_date": { - "name": "departure_date", - "type": "date", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 0, - "mappedType": "date" - }, - "tour_flight_id": { - "name": "tour_flight_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "outbound_flight_id": { - "name": "outbound_flight_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "inbound_flight_id": { - "name": "inbound_flight_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "makkah_hotel_id": { - "name": "makkah_hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "madinah_hotel_id": { - "name": "madinah_hotel_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "transportation_id": { - "name": "transportation_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "quad_price": { - "name": "quad_price", - "type": "numeric(10,0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "precision": 10, - "scale": 0, - "mappedType": "decimal" - }, - "triple_price": { - "name": "triple_price", - "type": "numeric(10,0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "precision": 10, - "scale": 0, - "mappedType": "decimal" - }, - "double_price": { - "name": "double_price", - "type": "numeric(10,0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "precision": 10, - "scale": 0, - "mappedType": "decimal" - }, - "infant_price": { - "name": "infant_price", - "type": "numeric(10,0)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "precision": 10, - "scale": 0, - "mappedType": "decimal" - }, - "itinerary_id": { - "name": "itinerary_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "package_detail", - "schema": "public", - "indexes": [ - { - "keyName": "package_detail_package_id_departure_date_unique", - "columnNames": ["package_id", "departure_date"], - "composite": true, - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "package_detail_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_detail_package_id_foreign": { - "constraintName": "package_detail_package_id_foreign", - "columnNames": ["package_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package", - "updateRule": "cascade" - }, - "package_detail_tour_flight_id_foreign": { - "constraintName": "package_detail_tour_flight_id_foreign", - "columnNames": ["tour_flight_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight_schedule", - "deleteRule": "cascade" - }, - "package_detail_outbound_flight_id_foreign": { - "constraintName": "package_detail_outbound_flight_id_foreign", - "columnNames": ["outbound_flight_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight_schedule", - "deleteRule": "cascade" - }, - "package_detail_inbound_flight_id_foreign": { - "constraintName": "package_detail_inbound_flight_id_foreign", - "columnNames": ["inbound_flight_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.flight_schedule", - "deleteRule": "cascade" - }, - "package_detail_makkah_hotel_id_foreign": { - "constraintName": "package_detail_makkah_hotel_id_foreign", - "columnNames": ["makkah_hotel_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel_schedule", - "deleteRule": "cascade" - }, - "package_detail_madinah_hotel_id_foreign": { - "constraintName": "package_detail_madinah_hotel_id_foreign", - "columnNames": ["madinah_hotel_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel_schedule", - "deleteRule": "cascade" - }, - "package_detail_transportation_id_foreign": { - "constraintName": "package_detail_transportation_id_foreign", - "columnNames": ["transportation_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.transportation_class", - "updateRule": "cascade" - }, - "package_detail_itinerary_id_foreign": { - "constraintName": "package_detail_itinerary_id_foreign", - "columnNames": ["itinerary_id"], - "localTableName": "public.package_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_itinerary", - "deleteRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "package_detail_id": { - "name": "package_detail_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "hotel_schedule_id": { - "name": "hotel_schedule_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - } - }, - "name": "package_detail_tour_hotels", - "schema": "public", - "indexes": [ - { - "keyName": "package_detail_tour_hotels_pkey", - "columnNames": ["package_detail_id", "hotel_schedule_id"], - "composite": true, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "package_detail_tour_hotels_package_detail_id_foreign": { - "constraintName": "package_detail_tour_hotels_package_detail_id_foreign", - "columnNames": ["package_detail_id"], - "localTableName": "public.package_detail_tour_hotels", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_detail", - "deleteRule": "cascade", - "updateRule": "cascade" - }, - "package_detail_tour_hotels_hotel_schedule_id_foreign": { - "constraintName": "package_detail_tour_hotels_hotel_schedule_id_foreign", - "columnNames": ["hotel_schedule_id"], - "localTableName": "public.package_detail_tour_hotels", - "referencedColumnNames": ["id"], - "referencedTableName": "public.hotel_schedule", - "deleteRule": "cascade", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "transportation_id": { - "name": "transportation_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "src": { - "name": "src", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "transportation_image", - "schema": "public", - "indexes": [ - { - "keyName": "transportation_image_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "transportation_image_transportation_id_foreign": { - "constraintName": "transportation_image_transportation_id_foreign", - "columnNames": ["transportation_id"], - "localTableName": "public.transportation_image", - "referencedColumnNames": ["id"], - "referencedTableName": "public.transportation_class", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "code": { - "name": "code", - "type": "char(6)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "character" - }, - "type": { - "name": "type", - "type": "verification_type", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "verification_type", - "enumItems": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ], - "mappedType": "enum" - }, - "expired_at": { - "name": "expired_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "verification", - "schema": "public", - "indexes": [ - { - "keyName": "verification_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": {}, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "email": { - "name": "email", - "type": "varchar(254)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 254, - "mappedType": "string" - }, - "whatsapp": { - "name": "whatsapp", - "type": "varchar(20)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 20, - "mappedType": "string" - }, - "password": { - "name": "password", - "type": "text", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "text" - }, - "avatar": { - "name": "avatar", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "verification_id": { - "name": "verification_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "partner", - "schema": "public", - "indexes": [ - { - "columnNames": ["email"], - "composite": false, - "keyName": "partner_email_unique", - "constraint": true, - "primary": false, - "unique": true - }, - { - "columnNames": ["whatsapp"], - "composite": false, - "keyName": "partner_whatsapp_unique", - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "partner_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "partner_verification_id_foreign": { - "constraintName": "partner_verification_id_foreign", - "columnNames": ["verification_id"], - "localTableName": "public.partner", - "referencedColumnNames": ["id"], - "referencedTableName": "public.verification", - "deleteRule": "set null", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "package_id": { - "name": "package_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "whatsapp": { - "name": "whatsapp", - "type": "varchar(20)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 20, - "mappedType": "string" - }, - "verification_id": { - "name": "verification_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "partner_id": { - "name": "partner_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "expired_at": { - "name": "expired_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 6, - "mappedType": "datetime" - }, - "purchased_at": { - "name": "purchased_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 6, - "mappedType": "datetime" - }, - "finished_at": { - "name": "finished_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 6, - "mappedType": "datetime" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "order", - "schema": "public", - "indexes": [ - { - "keyName": "order_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "order_package_id_foreign": { - "constraintName": "order_package_id_foreign", - "columnNames": ["package_id"], - "localTableName": "public.order", - "referencedColumnNames": ["id"], - "referencedTableName": "public.package_detail", - "updateRule": "cascade" - }, - "order_verification_id_foreign": { - "constraintName": "order_verification_id_foreign", - "columnNames": ["verification_id"], - "localTableName": "public.order", - "referencedColumnNames": ["id"], - "referencedTableName": "public.verification", - "deleteRule": "set null", - "updateRule": "cascade" - }, - "order_partner_id_foreign": { - "constraintName": "order_partner_id_foreign", - "columnNames": ["partner_id"], - "localTableName": "public.order", - "referencedColumnNames": ["id"], - "referencedTableName": "public.partner", - "deleteRule": "set null", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "order_id": { - "name": "order_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "room_type": { - "name": "room_type", - "type": "room_type", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "room_type", - "enumItems": ["double", "triple", "quad", "infant"], - "mappedType": "enum" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "order_detail", - "schema": "public", - "indexes": [ - { - "keyName": "order_detail_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "order_detail_order_id_foreign": { - "constraintName": "order_detail_order_id_foreign", - "columnNames": ["order_id"], - "localTableName": "public.order_detail", - "referencedColumnNames": ["id"], - "referencedTableName": "public.order", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - }, - { - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 30, - "mappedType": "string" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 100, - "mappedType": "string" - }, - "email": { - "name": "email", - "type": "varchar(254)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 254, - "mappedType": "string" - }, - "password": { - "name": "password", - "type": "text", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "mappedType": "text" - }, - "avatar": { - "name": "avatar", - "type": "varchar(100)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 100, - "mappedType": "string" - }, - "permissions": { - "name": "permissions", - "type": "admin_permission[]", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "nativeEnumName": "admin_permission", - "enumItems": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ], - "mappedType": "array" - }, - "verification_id": { - "name": "verification_id", - "type": "varchar(30)", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": true, - "length": 30, - "mappedType": "string" - }, - "created_at": { - "name": "created_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamptz", - "unsigned": false, - "autoincrement": false, - "primary": false, - "nullable": false, - "length": 6, - "mappedType": "datetime" - } - }, - "name": "admin", - "schema": "public", - "indexes": [ - { - "columnNames": ["email"], - "composite": false, - "keyName": "admin_email_unique", - "constraint": true, - "primary": false, - "unique": true - }, - { - "keyName": "admin_pkey", - "columnNames": ["id"], - "composite": false, - "constraint": true, - "primary": true, - "unique": true - } - ], - "checks": [], - "foreignKeys": { - "admin_verification_id_foreign": { - "constraintName": "admin_verification_id_foreign", - "columnNames": ["verification_id"], - "localTableName": "public.admin", - "referencedColumnNames": ["id"], - "referencedTableName": "public.verification", - "deleteRule": "set null", - "updateRule": "cascade" - } - }, - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } - } - ], - "nativeEnums": { - "skytrax_type": { - "name": "skytrax_type", - "schema": "public", - "items": ["full_service", "low_cost"] - }, - "package_type": { - "name": "package_type", - "schema": "public", - "items": ["reguler", "plus"] - }, - "package_class": { - "name": "package_class", - "schema": "public", - "items": ["silver", "gold", "platinum"] - }, - "package_itinerary_widget_type": { - "name": "package_itinerary_widget_type", - "schema": "public", - "items": ["hotel", "information", "transport"] - }, - "verification_type": { - "name": "verification_type", - "schema": "public", - "items": [ - "admin:create", - "admin:changeEmail", - "admin:changePassword", - "admin:update", - "partner:create", - "partner:changeEmail", - "partner:changePassword", - "partner:update", - "order:create" - ] - }, - "room_type": { - "name": "room_type", - "schema": "public", - "items": ["double", "triple", "quad", "infant"] - }, - "admin_permission": { - "name": "admin_permission", - "schema": "public", - "items": [ - "country:create", - "country:update", - "country:delete", - "city:create", - "city:update", - "city:delete", - "airline:create", - "airline:update", - "airline:delete", - "airport:create", - "airport:update", - "airport:delete", - "flight:create", - "flight:update", - "flight:delete", - "flight-class:create", - "flight-class:update", - "flight-class:delete", - "hotel-facility:create", - "hotel-facility:update", - "hotel-facility:delete", - "hotel:create", - "hotel:update", - "hotel:delete", - "transportation:create", - "transportation:update", - "transportation:delete", - "transportation-class:create", - "transportation-class:update", - "transportation-class:delete", - "package:create", - "package:update", - "package:delete", - "package-detail:create", - "package-detail:update", - "package-detail:delete", - "admin:create", - "admin:update", - "admin:delete", - "partner:create", - "partner:update", - "partner:delete" - ] - } - } + "namespaces": [ + "public" + ], + "name": "public", + "tables": [ + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "code": { + "name": "code", + "type": "varchar(10)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 10, + "mappedType": "string" + }, + "logo": { + "name": "logo", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "skytrax_rating": { + "name": "skytrax_rating", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "skytrax_type": { + "name": "skytrax_type", + "type": "skytrax_type", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "skytrax_type", + "enumItems": [ + "full_service", + "low_cost" + ], + "mappedType": "enum" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "airline", + "schema": "public", + "indexes": [ + { + "columnNames": [ + "code" + ], + "composite": false, + "keyName": "airline_code_unique", + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "airline_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "country", + "schema": "public", + "indexes": [ + { + "keyName": "country_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "country_id": { + "name": "country_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "city", + "schema": "public", + "indexes": [ + { + "keyName": "city_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "city_country_id_foreign": { + "constraintName": "city_country_id_foreign", + "columnNames": [ + "country_id" + ], + "localTableName": "public.city", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.country", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "code": { + "name": "code", + "type": "varchar(10)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 10, + "mappedType": "string" + }, + "city_id": { + "name": "city_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "airport", + "schema": "public", + "indexes": [ + { + "columnNames": [ + "code" + ], + "composite": false, + "keyName": "airport_code_unique", + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "airport_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "airport_city_id_foreign": { + "constraintName": "airport_city_id_foreign", + "columnNames": [ + "city_id" + ], + "localTableName": "public.airport", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.city", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "airline_id": { + "name": "airline_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "number": { + "name": "number", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "departure_airport_id": { + "name": "departure_airport_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "departure_terminal": { + "name": "departure_terminal", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "departure_gate": { + "name": "departure_gate", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "departure_time": { + "name": "departure_time", + "type": "time(0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 0, + "mappedType": "time" + }, + "arrival_airport_id": { + "name": "arrival_airport_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "arrival_terminal": { + "name": "arrival_terminal", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "arrival_gate": { + "name": "arrival_gate", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "duration": { + "name": "duration", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "aircraft": { + "name": "aircraft", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "flight", + "schema": "public", + "indexes": [ + { + "keyName": "flight_airline_id_number_unique", + "columnNames": [ + "airline_id", + "number" + ], + "composite": true, + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "flight_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "flight_airline_id_foreign": { + "constraintName": "flight_airline_id_foreign", + "columnNames": [ + "airline_id" + ], + "localTableName": "public.flight", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.airline", + "updateRule": "cascade" + }, + "flight_departure_airport_id_foreign": { + "constraintName": "flight_departure_airport_id_foreign", + "columnNames": [ + "departure_airport_id" + ], + "localTableName": "public.flight", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.airport", + "updateRule": "cascade" + }, + "flight_arrival_airport_id_foreign": { + "constraintName": "flight_arrival_airport_id_foreign", + "columnNames": [ + "arrival_airport_id" + ], + "localTableName": "public.flight", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.airport", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "flight_id": { + "name": "flight_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "class": { + "name": "class", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "seat_layout": { + "name": "seat_layout", + "type": "varchar(10)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 10, + "mappedType": "string" + }, + "baggage": { + "name": "baggage", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "cabin_baggage": { + "name": "cabin_baggage", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "flight_class", + "schema": "public", + "indexes": [ + { + "keyName": "flight_class_flight_id_class_unique", + "columnNames": [ + "flight_id", + "class" + ], + "composite": true, + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "flight_class_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "flight_class_flight_id_foreign": { + "constraintName": "flight_class_flight_id_foreign", + "columnNames": [ + "flight_id" + ], + "localTableName": "public.flight_class", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "flight_id": { + "name": "flight_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "next_id": { + "name": "next_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "flight_schedule", + "schema": "public", + "indexes": [ + { + "keyName": "flight_schedule_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "flight_schedule_flight_id_foreign": { + "constraintName": "flight_schedule_flight_id_foreign", + "columnNames": [ + "flight_id" + ], + "localTableName": "public.flight_schedule", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight_class", + "updateRule": "cascade" + }, + "flight_schedule_next_id_foreign": { + "constraintName": "flight_schedule_next_id_foreign", + "columnNames": [ + "next_id" + ], + "localTableName": "public.flight_schedule", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight_schedule", + "deleteRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "city_id": { + "name": "city_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "star": { + "name": "star", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "google_maps_link": { + "name": "google_maps_link", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 1000, + "mappedType": "string" + }, + "google_maps_embed": { + "name": "google_maps_embed", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 1000, + "mappedType": "string" + }, + "google_reviews_link": { + "name": "google_reviews_link", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 1000, + "mappedType": "string" + }, + "description": { + "name": "description", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 1000, + "mappedType": "string" + }, + "address": { + "name": "address", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "landmark": { + "name": "landmark", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "distance_to_landmark": { + "name": "distance_to_landmark", + "type": "numeric(10,0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "precision": 10, + "scale": 0, + "mappedType": "decimal" + }, + "food_type": { + "name": "food_type", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "food_amount": { + "name": "food_amount", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "food_menu": { + "name": "food_menu", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "hotel", + "schema": "public", + "indexes": [ + { + "keyName": "hotel_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "hotel_city_id_foreign": { + "constraintName": "hotel_city_id_foreign", + "columnNames": [ + "city_id" + ], + "localTableName": "public.hotel", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.city", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "icon": { + "name": "icon", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "hotel_facility", + "schema": "public", + "indexes": [ + { + "keyName": "hotel_facility_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "hotel_id": { + "name": "hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "hotel_facility_id": { + "name": "hotel_facility_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + } + }, + "name": "hotel_facilities", + "schema": "public", + "indexes": [ + { + "keyName": "hotel_facilities_pkey", + "columnNames": [ + "hotel_id", + "hotel_facility_id" + ], + "composite": true, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "hotel_facilities_hotel_id_foreign": { + "constraintName": "hotel_facilities_hotel_id_foreign", + "columnNames": [ + "hotel_id" + ], + "localTableName": "public.hotel_facilities", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "deleteRule": "cascade", + "updateRule": "cascade" + }, + "hotel_facilities_hotel_facility_id_foreign": { + "constraintName": "hotel_facilities_hotel_facility_id_foreign", + "columnNames": [ + "hotel_facility_id" + ], + "localTableName": "public.hotel_facilities", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel_facility", + "deleteRule": "cascade", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "hotel_id": { + "name": "hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "src": { + "name": "src", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "hotel_image", + "schema": "public", + "indexes": [ + { + "keyName": "hotel_image_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "hotel_image_hotel_id_foreign": { + "constraintName": "hotel_image_hotel_id_foreign", + "columnNames": [ + "hotel_id" + ], + "localTableName": "public.hotel_image", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "type": { + "name": "type", + "type": "package_type", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "package_type", + "enumItems": [ + "reguler", + "plus" + ], + "mappedType": "enum" + }, + "class": { + "name": "class", + "type": "package_class", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "package_class", + "enumItems": [ + "silver", + "gold", + "platinum" + ], + "mappedType": "enum" + }, + "thumbnail": { + "name": "thumbnail", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "use_fast_train": { + "name": "use_fast_train", + "type": "boolean", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "boolean" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "package", + "schema": "public", + "indexes": [ + { + "keyName": "package_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "title": { + "name": "title", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "description": { + "name": "description", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 1000, + "mappedType": "string" + }, + "next_id": { + "name": "next_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "package_itinerary_day", + "schema": "public", + "indexes": [ + { + "keyName": "package_itinerary_day_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_itinerary_day_next_id_foreign": { + "constraintName": "package_itinerary_day_next_id_foreign", + "columnNames": [ + "next_id" + ], + "localTableName": "public.package_itinerary_day", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary_day", + "deleteRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "location": { + "name": "location", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "day_id": { + "name": "day_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "next_id": { + "name": "next_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "package_itinerary", + "schema": "public", + "indexes": [ + { + "keyName": "package_itinerary_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_itinerary_day_id_foreign": { + "constraintName": "package_itinerary_day_id_foreign", + "columnNames": [ + "day_id" + ], + "localTableName": "public.package_itinerary", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary_day", + "deleteRule": "cascade" + }, + "package_itinerary_next_id_foreign": { + "constraintName": "package_itinerary_next_id_foreign", + "columnNames": [ + "next_id" + ], + "localTableName": "public.package_itinerary", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary", + "deleteRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "package_itinerary_id": { + "name": "package_itinerary_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "src": { + "name": "src", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "package_itinerary_image", + "schema": "public", + "indexes": [ + { + "keyName": "package_itinerary_image_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_itinerary_image_package_itinerary_id_foreign": { + "constraintName": "package_itinerary_image_package_itinerary_id_foreign", + "columnNames": [ + "package_itinerary_id" + ], + "localTableName": "public.package_itinerary_image", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "package_itinerary_day_id": { + "name": "package_itinerary_day_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "type": { + "name": "type", + "type": "package_itinerary_widget_type", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "package_itinerary_widget_type", + "enumItems": [ + "hotel", + "information", + "transport" + ], + "mappedType": "enum" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "hotel_id": { + "name": "hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "description": { + "name": "description", + "type": "varchar(1000)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 1000, + "mappedType": "string" + }, + "transportation": { + "name": "transportation", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "from": { + "name": "from", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "to": { + "name": "to", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + } + }, + "name": "package_itinerary_widget", + "schema": "public", + "indexes": [ + { + "columnNames": [ + "type" + ], + "composite": false, + "keyName": "package_itinerary_widget_type_index", + "constraint": false, + "primary": false, + "unique": false + }, + { + "keyName": "package_itinerary_widget_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_itinerary_widget_package_itinerary_day_id_foreign": { + "constraintName": "package_itinerary_widget_package_itinerary_day_id_foreign", + "columnNames": [ + "package_itinerary_day_id" + ], + "localTableName": "public.package_itinerary_widget", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary_day", + "updateRule": "cascade" + }, + "package_itinerary_widget_hotel_id_foreign": { + "constraintName": "package_itinerary_widget_hotel_id_foreign", + "columnNames": [ + "hotel_id" + ], + "localTableName": "public.package_itinerary_widget", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "deleteRule": "set null", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "type": { + "name": "type", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "transportation", + "schema": "public", + "indexes": [ + { + "keyName": "transportation_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "transportation_id": { + "name": "transportation_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "class": { + "name": "class", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "total_seats": { + "name": "total_seats", + "type": "int", + "unsigned": true, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "integer" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "transportation_class", + "schema": "public", + "indexes": [ + { + "keyName": "transportation_class_transportation_id_class_unique", + "columnNames": [ + "transportation_id", + "class" + ], + "composite": true, + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "transportation_class_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "transportation_class_transportation_id_foreign": { + "constraintName": "transportation_class_transportation_id_foreign", + "columnNames": [ + "transportation_id" + ], + "localTableName": "public.transportation_class", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.transportation", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "package_id": { + "name": "package_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "departure_date": { + "name": "departure_date", + "type": "date", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 0, + "mappedType": "date" + }, + "tour_flight_id": { + "name": "tour_flight_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "outbound_flight_id": { + "name": "outbound_flight_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "inbound_flight_id": { + "name": "inbound_flight_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "makkah_hotel_id": { + "name": "makkah_hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "madinah_hotel_id": { + "name": "madinah_hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "transportation_id": { + "name": "transportation_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "quad_price": { + "name": "quad_price", + "type": "numeric(10,0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "precision": 10, + "scale": 0, + "mappedType": "decimal" + }, + "triple_price": { + "name": "triple_price", + "type": "numeric(10,0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "precision": 10, + "scale": 0, + "mappedType": "decimal" + }, + "double_price": { + "name": "double_price", + "type": "numeric(10,0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "precision": 10, + "scale": 0, + "mappedType": "decimal" + }, + "infant_price": { + "name": "infant_price", + "type": "numeric(10,0)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "precision": 10, + "scale": 0, + "mappedType": "decimal" + }, + "itinerary_id": { + "name": "itinerary_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "package_detail", + "schema": "public", + "indexes": [ + { + "keyName": "package_detail_package_id_departure_date_unique", + "columnNames": [ + "package_id", + "departure_date" + ], + "composite": true, + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "package_detail_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_detail_package_id_foreign": { + "constraintName": "package_detail_package_id_foreign", + "columnNames": [ + "package_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package", + "updateRule": "cascade" + }, + "package_detail_tour_flight_id_foreign": { + "constraintName": "package_detail_tour_flight_id_foreign", + "columnNames": [ + "tour_flight_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight_schedule", + "deleteRule": "cascade" + }, + "package_detail_outbound_flight_id_foreign": { + "constraintName": "package_detail_outbound_flight_id_foreign", + "columnNames": [ + "outbound_flight_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight_schedule", + "deleteRule": "cascade" + }, + "package_detail_inbound_flight_id_foreign": { + "constraintName": "package_detail_inbound_flight_id_foreign", + "columnNames": [ + "inbound_flight_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.flight_schedule", + "deleteRule": "cascade" + }, + "package_detail_makkah_hotel_id_foreign": { + "constraintName": "package_detail_makkah_hotel_id_foreign", + "columnNames": [ + "makkah_hotel_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "deleteRule": "cascade" + }, + "package_detail_madinah_hotel_id_foreign": { + "constraintName": "package_detail_madinah_hotel_id_foreign", + "columnNames": [ + "madinah_hotel_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "deleteRule": "cascade" + }, + "package_detail_transportation_id_foreign": { + "constraintName": "package_detail_transportation_id_foreign", + "columnNames": [ + "transportation_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.transportation_class", + "updateRule": "cascade" + }, + "package_detail_itinerary_id_foreign": { + "constraintName": "package_detail_itinerary_id_foreign", + "columnNames": [ + "itinerary_id" + ], + "localTableName": "public.package_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_itinerary", + "deleteRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "package_detail_id": { + "name": "package_detail_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "hotel_id": { + "name": "hotel_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + } + }, + "name": "package_detail_tour_hotels", + "schema": "public", + "indexes": [ + { + "keyName": "package_detail_tour_hotels_pkey", + "columnNames": [ + "package_detail_id", + "hotel_id" + ], + "composite": true, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "package_detail_tour_hotels_package_detail_id_foreign": { + "constraintName": "package_detail_tour_hotels_package_detail_id_foreign", + "columnNames": [ + "package_detail_id" + ], + "localTableName": "public.package_detail_tour_hotels", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_detail", + "deleteRule": "cascade", + "updateRule": "cascade" + }, + "package_detail_tour_hotels_hotel_id_foreign": { + "constraintName": "package_detail_tour_hotels_hotel_id_foreign", + "columnNames": [ + "hotel_id" + ], + "localTableName": "public.package_detail_tour_hotels", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.hotel", + "deleteRule": "cascade", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "transportation_id": { + "name": "transportation_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "src": { + "name": "src", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "transportation_image", + "schema": "public", + "indexes": [ + { + "keyName": "transportation_image_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "transportation_image_transportation_id_foreign": { + "constraintName": "transportation_image_transportation_id_foreign", + "columnNames": [ + "transportation_id" + ], + "localTableName": "public.transportation_image", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.transportation_class", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "code": { + "name": "code", + "type": "char(6)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "character" + }, + "type": { + "name": "type", + "type": "verification_type", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "verification_type", + "enumItems": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ], + "mappedType": "enum" + }, + "expired_at": { + "name": "expired_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "verification", + "schema": "public", + "indexes": [ + { + "keyName": "verification_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": {}, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "email": { + "name": "email", + "type": "varchar(254)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 254, + "mappedType": "string" + }, + "whatsapp": { + "name": "whatsapp", + "type": "varchar(20)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 20, + "mappedType": "string" + }, + "password": { + "name": "password", + "type": "text", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "text" + }, + "avatar": { + "name": "avatar", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "verification_id": { + "name": "verification_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "partner", + "schema": "public", + "indexes": [ + { + "columnNames": [ + "email" + ], + "composite": false, + "keyName": "partner_email_unique", + "constraint": true, + "primary": false, + "unique": true + }, + { + "columnNames": [ + "whatsapp" + ], + "composite": false, + "keyName": "partner_whatsapp_unique", + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "partner_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "partner_verification_id_foreign": { + "constraintName": "partner_verification_id_foreign", + "columnNames": [ + "verification_id" + ], + "localTableName": "public.partner", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.verification", + "deleteRule": "set null", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "package_id": { + "name": "package_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "whatsapp": { + "name": "whatsapp", + "type": "varchar(20)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 20, + "mappedType": "string" + }, + "verification_id": { + "name": "verification_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "partner_id": { + "name": "partner_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "expired_at": { + "name": "expired_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 6, + "mappedType": "datetime" + }, + "purchased_at": { + "name": "purchased_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 6, + "mappedType": "datetime" + }, + "finished_at": { + "name": "finished_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 6, + "mappedType": "datetime" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "order", + "schema": "public", + "indexes": [ + { + "keyName": "order_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "order_package_id_foreign": { + "constraintName": "order_package_id_foreign", + "columnNames": [ + "package_id" + ], + "localTableName": "public.order", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.package_detail", + "updateRule": "cascade" + }, + "order_verification_id_foreign": { + "constraintName": "order_verification_id_foreign", + "columnNames": [ + "verification_id" + ], + "localTableName": "public.order", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.verification", + "deleteRule": "set null", + "updateRule": "cascade" + }, + "order_partner_id_foreign": { + "constraintName": "order_partner_id_foreign", + "columnNames": [ + "partner_id" + ], + "localTableName": "public.order", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.partner", + "deleteRule": "set null", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "order_id": { + "name": "order_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "room_type": { + "name": "room_type", + "type": "room_type", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "room_type", + "enumItems": [ + "double", + "triple", + "quad", + "infant" + ], + "mappedType": "enum" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "order_detail", + "schema": "public", + "indexes": [ + { + "keyName": "order_detail_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "order_detail_order_id_foreign": { + "constraintName": "order_detail_order_id_foreign", + "columnNames": [ + "order_id" + ], + "localTableName": "public.order_detail", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.order", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + }, + { + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 30, + "mappedType": "string" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 100, + "mappedType": "string" + }, + "email": { + "name": "email", + "type": "varchar(254)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 254, + "mappedType": "string" + }, + "password": { + "name": "password", + "type": "text", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "mappedType": "text" + }, + "avatar": { + "name": "avatar", + "type": "varchar(100)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 100, + "mappedType": "string" + }, + "permissions": { + "name": "permissions", + "type": "admin_permission[]", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "nativeEnumName": "admin_permission", + "enumItems": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ], + "mappedType": "array" + }, + "verification_id": { + "name": "verification_id", + "type": "varchar(30)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 30, + "mappedType": "string" + }, + "created_at": { + "name": "created_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamptz", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": false, + "length": 6, + "mappedType": "datetime" + } + }, + "name": "admin", + "schema": "public", + "indexes": [ + { + "columnNames": [ + "email" + ], + "composite": false, + "keyName": "admin_email_unique", + "constraint": true, + "primary": false, + "unique": true + }, + { + "keyName": "admin_pkey", + "columnNames": [ + "id" + ], + "composite": false, + "constraint": true, + "primary": true, + "unique": true + } + ], + "checks": [], + "foreignKeys": { + "admin_verification_id_foreign": { + "constraintName": "admin_verification_id_foreign", + "columnNames": [ + "verification_id" + ], + "localTableName": "public.admin", + "referencedColumnNames": [ + "id" + ], + "referencedTableName": "public.verification", + "deleteRule": "set null", + "updateRule": "cascade" + } + }, + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } + } + ], + "nativeEnums": { + "skytrax_type": { + "name": "skytrax_type", + "schema": "public", + "items": [ + "full_service", + "low_cost" + ] + }, + "package_type": { + "name": "package_type", + "schema": "public", + "items": [ + "reguler", + "plus" + ] + }, + "package_class": { + "name": "package_class", + "schema": "public", + "items": [ + "silver", + "gold", + "platinum" + ] + }, + "package_itinerary_widget_type": { + "name": "package_itinerary_widget_type", + "schema": "public", + "items": [ + "hotel", + "information", + "transport" + ] + }, + "verification_type": { + "name": "verification_type", + "schema": "public", + "items": [ + "admin:create", + "admin:changeEmail", + "admin:changePassword", + "admin:update", + "partner:create", + "partner:changeEmail", + "partner:changePassword", + "partner:update", + "order:create" + ] + }, + "room_type": { + "name": "room_type", + "schema": "public", + "items": [ + "double", + "triple", + "quad", + "infant" + ] + }, + "admin_permission": { + "name": "admin_permission", + "schema": "public", + "items": [ + "country:create", + "country:update", + "country:delete", + "city:create", + "city:update", + "city:delete", + "airline:create", + "airline:update", + "airline:delete", + "airport:create", + "airport:update", + "airport:delete", + "flight:create", + "flight:update", + "flight:delete", + "flight-class:create", + "flight-class:update", + "flight-class:delete", + "hotel-facility:create", + "hotel-facility:update", + "hotel-facility:delete", + "hotel:create", + "hotel:update", + "hotel:delete", + "transportation:create", + "transportation:update", + "transportation:delete", + "transportation-class:create", + "transportation-class:update", + "transportation-class:delete", + "package:create", + "package:update", + "package:delete", + "package-detail:create", + "package-detail:update", + "package-detail:delete", + "admin:create", + "admin:update", + "admin:delete", + "partner:create", + "partner:update", + "partner:delete" + ] + } + } } diff --git a/src/database/migrations/Migration20251104110158.ts b/src/database/migrations/Migration20251104110158.ts deleted file mode 100644 index 91f17ae..0000000 --- a/src/database/migrations/Migration20251104110158.ts +++ /dev/null @@ -1,367 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251104110158 extends Migration { - override async up(): Promise { - this.addSql( - `create table "airline" ("id" varchar(30) not null, "code" varchar(10) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "logo" varchar(100) not null, "skytrax_rating" int null, "skytrax_type" text check ("skytrax_type" in ('full_service', 'low_cost')) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "airline_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "airline" add constraint "airline_code_unique" unique ("code");`, - ); - this.addSql( - `alter table "airline" add constraint "airline_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "airline" add constraint "airline_logo_unique" unique ("logo");`, - ); - - this.addSql( - `create table "country" ("id" varchar(30) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "country_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "country" add constraint "country_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "city" ("id" varchar(30) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "country_id" varchar(30) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "city_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "city" add constraint "city_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "airport" ("id" varchar(30) not null, "code" varchar(10) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "city_id" varchar(30) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "airport_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "airport" add constraint "airport_code_unique" unique ("code");`, - ); - this.addSql( - `alter table "airport" add constraint "airport_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "flight" ("id" varchar(30) not null, "slug" varchar(220) not null, "airline_id" varchar(30) not null, "number" int not null, "departure_airport_id" varchar(30) not null, "departure_terminal" varchar(100) null, "departure_gate" varchar(100) null, "departure_time" time(0) not null, "arrival_airport_id" varchar(30) not null, "arrival_terminal" varchar(100) null, "arrival_gate" varchar(100) null, "duration" int not null, "aircraft" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "flight" add constraint "flight_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "flight" add constraint "flight_airline_id_number_unique" unique ("airline_id", "number");`, - ); - - this.addSql( - `create table "flight_class" ("id" varchar(30) not null, "slug" varchar(420) not null, "flight_id" varchar(30) not null, "class" varchar(100) not null, "seat_layout" varchar(10) not null, "baggage" int not null, "cabin_baggage" int not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_class_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "flight_class" add constraint "flight_class_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "flight_class" add constraint "flight_class_flight_id_class_unique" unique ("flight_id", "class");`, - ); - - this.addSql( - `create table "hotel" ("id" varchar(30) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "city_id" varchar(30) not null, "star" int not null, "google_maps_link" varchar(500) not null, "google_maps_embed" varchar(500) not null, "google_reviews_link" varchar(500) not null, "description" varchar(1000) not null, "address" varchar(100) not null, "landmark" varchar(100) not null, "distance_to_landmark" numeric(10,0) not null, "food_type" varchar(100) not null, "food_amount" int not null, "food_menu" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "hotel_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "hotel" add constraint "hotel_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "hotel_facility" ("id" varchar(30) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "icon" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "hotel_facility_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "hotel_facility" add constraint "hotel_facility_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "hotel_facilities" ("hotel_id" varchar(30) not null, "hotel_facility_id" varchar(30) not null, constraint "hotel_facilities_pkey" primary key ("hotel_id", "hotel_facility_id"));`, - ); - - this.addSql( - `create table "hotel_image" ("id" varchar(30) not null, "hotel_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "hotel_image_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "package" ("id" varchar(30) not null, "slug" varchar(200) not null, "name" varchar(100) not null, "type" text check ("type" in ('reguler', 'plus')) not null, "class" text check ("class" in ('silver', 'gold', 'platinum')) not null, "thumbnail" varchar(100) not null, "use_fast_train" boolean not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "package" add constraint "package_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "package" add constraint "package_thumbnail_unique" unique ("thumbnail");`, - ); - - this.addSql( - `create table "transportation" ("id" varchar(30) not null, "slug" varchar(100) not null, "name" varchar(100) not null, "type" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "transportation_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "transportation" add constraint "transportation_slug_unique" unique ("slug");`, - ); - - this.addSql( - `create table "transportation_class" ("id" varchar(30) not null, "slug" varchar(400) not null, "transportation_id" varchar(30) not null, "class" varchar(100) not null, "total_seats" int not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "transportation_class_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "transportation_class" add constraint "transportation_class_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "transportation_class" add constraint "transportation_class_transportation_id_class_unique" unique ("transportation_id", "class");`, - ); - - this.addSql( - `create table "package_detail" ("id" varchar(30) not null, "slug" varchar(200) not null, "package_id" varchar(30) not null, "departure_date" date not null, "makkah_hotel_id" varchar(30) not null, "madinah_hotel_id" varchar(30) not null, "transportation_id" varchar(30) not null, "quad_price" numeric(10,0) not null, "triple_price" numeric(10,0) not null, "double_price" numeric(10,0) not null, "infant_price" numeric(10,0) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_detail_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_slug_unique" unique ("slug");`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_package_id_departure_date_unique" unique ("package_id", "departure_date");`, - ); - - this.addSql( - `create table "package_detail_tour_hotels" ("id" serial primary key, "package_detail_id" varchar(30) not null, "hotel_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "package_detail_tour_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "package_detail_outbound_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "package_detail_inbound_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "transportation_class_image" ("id" varchar(30) not null, "transportation_class_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "transportation_class_image_pkey" primary key ("id"));`, - ); - - this.addSql( - `alter table "city" add constraint "city_country_id_foreign" foreign key ("country_id") references "country" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "airport" add constraint "airport_city_id_foreign" foreign key ("city_id") references "city" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "flight" add constraint "flight_airline_id_foreign" foreign key ("airline_id") references "airline" ("id") on update cascade;`, - ); - this.addSql( - `alter table "flight" add constraint "flight_departure_airport_id_foreign" foreign key ("departure_airport_id") references "airport" ("id") on update cascade;`, - ); - this.addSql( - `alter table "flight" add constraint "flight_arrival_airport_id_foreign" foreign key ("arrival_airport_id") references "airport" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "flight_class" add constraint "flight_class_flight_id_foreign" foreign key ("flight_id") references "flight" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "hotel" add constraint "hotel_city_id_foreign" foreign key ("city_id") references "city" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "hotel_facilities" add constraint "hotel_facilities_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "hotel_facilities" add constraint "hotel_facilities_hotel_facility_id_foreign" foreign key ("hotel_facility_id") references "hotel_facility" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "transportation_class" add constraint "transportation_class_transportation_id_foreign" foreign key ("transportation_id") references "transportation" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail" add constraint "package_detail_package_id_foreign" foreign key ("package_id") references "package" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail_tour_flight_classes" add constraint "package_detail_tour_flight_classes_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_tour_flight_classes" add constraint "package_detail_tour_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail_outbound_flight_classes" add constraint "package_detail_outbound_flight_classes_package_d_8b70d_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_outbound_flight_classes" add constraint "package_detail_outbound_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail_inbound_flight_classes" add constraint "package_detail_inbound_flight_classes_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_inbound_flight_classes" add constraint "package_detail_inbound_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "transportation_class_image" add constraint "transportation_class_image_transportation_class_id_foreign" foreign key ("transportation_class_id") references "transportation_class" ("id") on update cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "flight" drop constraint "flight_airline_id_foreign";`, - ); - - this.addSql( - `alter table "city" drop constraint "city_country_id_foreign";`, - ); - - this.addSql( - `alter table "airport" drop constraint "airport_city_id_foreign";`, - ); - - this.addSql(`alter table "hotel" drop constraint "hotel_city_id_foreign";`); - - this.addSql( - `alter table "flight" drop constraint "flight_departure_airport_id_foreign";`, - ); - - this.addSql( - `alter table "flight" drop constraint "flight_arrival_airport_id_foreign";`, - ); - - this.addSql( - `alter table "flight_class" drop constraint "flight_class_flight_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_flight_classes" drop constraint "package_detail_tour_flight_classes_flight_class_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_outbound_flight_classes" drop constraint "package_detail_outbound_flight_classes_flight_class_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_inbound_flight_classes" drop constraint "package_detail_inbound_flight_classes_flight_class_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_facilities" drop constraint "hotel_facilities_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_facilities" drop constraint "hotel_facilities_hotel_facility_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_package_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_class" drop constraint "transportation_class_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_class_image" drop constraint "transportation_class_image_transportation_class_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_package_detail_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_flight_classes" drop constraint "package_detail_tour_flight_classes_package_detail_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_outbound_flight_classes" drop constraint "package_detail_outbound_flight_classes_package_d_8b70d_foreign";`, - ); - - this.addSql( - `alter table "package_detail_inbound_flight_classes" drop constraint "package_detail_inbound_flight_classes_package_detail_id_foreign";`, - ); - - this.addSql(`drop table if exists "airline" cascade;`); - - this.addSql(`drop table if exists "country" cascade;`); - - this.addSql(`drop table if exists "city" cascade;`); - - this.addSql(`drop table if exists "airport" cascade;`); - - this.addSql(`drop table if exists "flight" cascade;`); - - this.addSql(`drop table if exists "flight_class" cascade;`); - - this.addSql(`drop table if exists "hotel" cascade;`); - - this.addSql(`drop table if exists "hotel_facility" cascade;`); - - this.addSql(`drop table if exists "hotel_facilities" cascade;`); - - this.addSql(`drop table if exists "hotel_image" cascade;`); - - this.addSql(`drop table if exists "package" cascade;`); - - this.addSql(`drop table if exists "transportation" cascade;`); - - this.addSql(`drop table if exists "transportation_class" cascade;`); - - this.addSql(`drop table if exists "package_detail" cascade;`); - - this.addSql(`drop table if exists "package_detail_tour_hotels" cascade;`); - - this.addSql( - `drop table if exists "package_detail_tour_flight_classes" cascade;`, - ); - - this.addSql( - `drop table if exists "package_detail_outbound_flight_classes" cascade;`, - ); - - this.addSql( - `drop table if exists "package_detail_inbound_flight_classes" cascade;`, - ); - - this.addSql(`drop table if exists "transportation_class_image" cascade;`); - } -} diff --git a/src/database/migrations/Migration20251108053920.ts b/src/database/migrations/Migration20251108053920.ts deleted file mode 100644 index 1bf17a7..0000000 --- a/src/database/migrations/Migration20251108053920.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251108053920 extends Migration { - override async up(): Promise { - this.addSql( - `create table "hotel_schedule" ("id" varchar(30) not null, "hotel_id" varchar(30) not null, "check_in" time(0) not null, "check_out" time(0) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "hotel_schedule_pkey" primary key ("id"));`, - ); - - this.addSql( - `alter table "hotel_schedule" add constraint "hotel_schedule_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "flight_class" alter column "slug" type varchar(200) using ("slug"::varchar(200));`, - ); - - this.addSql( - `alter table "transportation_class" alter column "slug" type varchar(200) using ("slug"::varchar(200));`, - ); - - this.addSql( - `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel_schedule" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" rename column "hotel_id" to "hotel_schedule_id";`, - ); - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_hotel_schedule_id_foreign" foreign key ("hotel_schedule_id") references "hotel_schedule" ("id") on update cascade on delete cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_hotel_schedule_id_foreign";`, - ); - - this.addSql(`drop table if exists "hotel_schedule" cascade;`); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "flight_class" alter column "slug" type varchar(420) using ("slug"::varchar(420));`, - ); - - this.addSql( - `alter table "transportation_class" alter column "slug" type varchar(400) using ("slug"::varchar(400));`, - ); - - this.addSql( - `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" rename column "hotel_schedule_id" to "hotel_id";`, - ); - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251110080126.ts b/src/database/migrations/Migration20251110080126.ts deleted file mode 100644 index 01b9ab7..0000000 --- a/src/database/migrations/Migration20251110080126.ts +++ /dev/null @@ -1,226 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251110080126 extends Migration { - override async up(): Promise { - this.addSql( - `create table "flight_schedule" ("id" varchar(30) not null, "flight_id" varchar(30) not null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_schedule_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "package_itinerary_day" ("id" varchar(30) not null, "title" varchar(100) not null, "description" varchar(1000) not null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_itinerary_day_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "package_itinerary" ("id" varchar(30) not null, "location" varchar(100) not null, "day_id" varchar(30) not null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_itinerary_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "package_itinerary_image" ("id" varchar(30) not null, "package_itinerary_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "package_itinerary_image_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "package_itinerary_widget" ("id" varchar(30) not null, "package_itinerary_day_id" varchar(30) not null, "type" text check ("type" in ('transport', 'hotel', 'information')) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "hotel_id" varchar(30) null, "description" varchar(1000) null, "transportation" varchar(100) null, "from" varchar(100) null, "to" varchar(100) null, constraint "package_itinerary_widget_pkey" primary key ("id"));`, - ); - this.addSql( - `create index "package_itinerary_widget_type_index" on "package_itinerary_widget" ("type");`, - ); - - this.addSql( - `create table "transportation_image" ("id" varchar(30) not null, "transportation_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "transportation_image_pkey" primary key ("id"));`, - ); - - this.addSql( - `alter table "flight_schedule" add constraint "flight_schedule_flight_id_foreign" foreign key ("flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "flight_schedule" add constraint "flight_schedule_next_id_foreign" foreign key ("next_id") references "flight_schedule" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "package_itinerary_day" add constraint "package_itinerary_day_next_id_foreign" foreign key ("next_id") references "package_itinerary_day" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_day_id_foreign" foreign key ("day_id") references "package_itinerary_day" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_next_id_foreign" foreign key ("next_id") references "package_itinerary" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "package_itinerary_image" add constraint "package_itinerary_image_package_itinerary_id_foreign" foreign key ("package_itinerary_id") references "package_itinerary" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_itinerary_widget" add constraint "package_itinerary_widget_package_itinerary_day_id_foreign" foreign key ("package_itinerary_day_id") references "package_itinerary_day" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_itinerary_widget" add constraint "package_itinerary_widget_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, - ); - - this.addSql( - `drop table if exists "package_detail_tour_flight_classes" cascade;`, - ); - - this.addSql( - `drop table if exists "package_detail_outbound_flight_classes" cascade;`, - ); - - this.addSql( - `drop table if exists "package_detail_inbound_flight_classes" cascade;`, - ); - - this.addSql(`drop table if exists "transportation_class_image" cascade;`); - - this.addSql( - `alter table "airline" alter column "skytrax_rating" type int using ("skytrax_rating"::int);`, - ); - this.addSql( - `alter table "airline" alter column "skytrax_rating" set not null;`, - ); - - this.addSql( - `alter table "package_detail" add column "tour_flight_id" varchar(30) not null, add column "outbound_flight_id" varchar(30) not null, add column "inbound_flight_id" varchar(30) not null, add column "package_itinerary_id" varchar(30) not null;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_package_itinerary_id_foreign" foreign key ("package_itinerary_id") references "package_itinerary" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_pkey";`, - ); - this.addSql(`alter table "package_detail_tour_hotels" drop column "id";`); - - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_pkey" primary key ("package_detail_id", "hotel_schedule_id");`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "flight_schedule" drop constraint "flight_schedule_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary_day" drop constraint "package_itinerary_day_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_day_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary_widget" drop constraint "package_itinerary_widget_package_itinerary_day_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary_image" drop constraint "package_itinerary_image_package_itinerary_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_package_itinerary_id_foreign";`, - ); - - this.addSql( - `create table "package_detail_tour_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "package_detail_outbound_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "package_detail_inbound_flight_classes" ("id" serial primary key, "package_detail_id" varchar(30) not null, "flight_class_id" varchar(30) not null);`, - ); - - this.addSql( - `create table "transportation_class_image" ("id" varchar(30) not null, "transportation_class_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "transportation_class_image_pkey" primary key ("id"));`, - ); - - this.addSql( - `alter table "package_detail_tour_flight_classes" add constraint "package_detail_tour_flight_classes_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_tour_flight_classes" add constraint "package_detail_tour_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail_outbound_flight_classes" add constraint "package_detail_outbound_flight_classes_package_d_8b70d_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_outbound_flight_classes" add constraint "package_detail_outbound_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail_inbound_flight_classes" add constraint "package_detail_inbound_flight_classes_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, - ); - this.addSql( - `alter table "package_detail_inbound_flight_classes" add constraint "package_detail_inbound_flight_classes_flight_class_id_foreign" foreign key ("flight_class_id") references "flight_class" ("id") on update cascade on delete cascade;`, - ); - - this.addSql( - `alter table "transportation_class_image" add constraint "transportation_class_image_transportation_class_id_foreign" foreign key ("transportation_class_id") references "transportation_class" ("id") on update cascade;`, - ); - - this.addSql(`drop table if exists "flight_schedule" cascade;`); - - this.addSql(`drop table if exists "package_itinerary_day" cascade;`); - - this.addSql(`drop table if exists "package_itinerary" cascade;`); - - this.addSql(`drop table if exists "package_itinerary_image" cascade;`); - - this.addSql(`drop table if exists "package_itinerary_widget" cascade;`); - - this.addSql(`drop table if exists "transportation_image" cascade;`); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, - ); - - this.addSql( - `alter table "airline" alter column "skytrax_rating" type int using ("skytrax_rating"::int);`, - ); - this.addSql( - `alter table "airline" alter column "skytrax_rating" drop not null;`, - ); - - this.addSql( - `alter table "package_detail" drop column "tour_flight_id", drop column "outbound_flight_id", drop column "inbound_flight_id", drop column "package_itinerary_id";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_pkey";`, - ); - - this.addSql( - `alter table "package_detail_tour_hotels" add column "id" serial not null;`, - ); - this.addSql( - `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_pkey" primary key ("id");`, - ); - } -} diff --git a/src/database/migrations/Migration20251111010042.ts b/src/database/migrations/Migration20251111010042.ts deleted file mode 100644 index 6d75a37..0000000 --- a/src/database/migrations/Migration20251111010042.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251111010042 extends Migration { - override async up(): Promise { - this.addSql(`alter table "airline" drop constraint "airline_slug_unique";`); - this.addSql(`alter table "airline" drop column "slug";`); - - this.addSql(`alter table "country" drop constraint "country_slug_unique";`); - this.addSql(`alter table "country" drop column "slug";`); - - this.addSql(`alter table "city" drop constraint "city_slug_unique";`); - this.addSql(`alter table "city" drop column "slug";`); - - this.addSql(`alter table "airport" drop constraint "airport_slug_unique";`); - this.addSql(`alter table "airport" drop column "slug";`); - - this.addSql(`alter table "flight" drop constraint "flight_slug_unique";`); - this.addSql(`alter table "flight" drop column "slug";`); - - this.addSql( - `alter table "flight_class" drop constraint "flight_class_slug_unique";`, - ); - this.addSql(`alter table "flight_class" drop column "slug";`); - - this.addSql(`alter table "hotel" drop constraint "hotel_slug_unique";`); - this.addSql(`alter table "hotel" drop column "slug";`); - - this.addSql( - `alter table "hotel_facility" drop constraint "hotel_facility_slug_unique";`, - ); - this.addSql(`alter table "hotel_facility" drop column "slug";`); - - this.addSql(`alter table "package" drop constraint "package_slug_unique";`); - this.addSql(`alter table "package" drop column "slug";`); - - this.addSql( - `alter table "transportation" drop constraint "transportation_slug_unique";`, - ); - this.addSql(`alter table "transportation" drop column "slug";`); - - this.addSql( - `alter table "transportation_class" drop constraint "transportation_class_slug_unique";`, - ); - this.addSql(`alter table "transportation_class" drop column "slug";`); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_slug_unique";`, - ); - this.addSql(`alter table "package_detail" drop column "slug";`); - } - - override async down(): Promise { - this.addSql( - `alter table "airline" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "airline" add constraint "airline_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "country" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "country" add constraint "country_slug_unique" unique ("slug");`, - ); - - this.addSql(`alter table "city" add column "slug" varchar(200) not null;`); - this.addSql( - `alter table "city" add constraint "city_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "airport" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "airport" add constraint "airport_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "flight" add column "slug" varchar(220) not null;`, - ); - this.addSql( - `alter table "flight" add constraint "flight_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "flight_class" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "flight_class" add constraint "flight_class_slug_unique" unique ("slug");`, - ); - - this.addSql(`alter table "hotel" add column "slug" varchar(200) not null;`); - this.addSql( - `alter table "hotel" add constraint "hotel_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "hotel_facility" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "hotel_facility" add constraint "hotel_facility_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "package" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "package" add constraint "package_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "transportation" add column "slug" varchar(100) not null;`, - ); - this.addSql( - `alter table "transportation" add constraint "transportation_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "transportation_class" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "transportation_class" add constraint "transportation_class_slug_unique" unique ("slug");`, - ); - - this.addSql( - `alter table "package_detail" add column "slug" varchar(200) not null;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_slug_unique" unique ("slug");`, - ); - } -} diff --git a/src/database/migrations/Migration20251112104244.ts b/src/database/migrations/Migration20251112104244.ts deleted file mode 100644 index 624c3a7..0000000 --- a/src/database/migrations/Migration20251112104244.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251112104244 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "hotel" alter column "google_maps_link" type varchar(1000) using ("google_maps_link"::varchar(1000));`, - ); - this.addSql( - `alter table "hotel" alter column "google_maps_embed" type varchar(1000) using ("google_maps_embed"::varchar(1000));`, - ); - this.addSql( - `alter table "hotel" alter column "google_reviews_link" type varchar(1000) using ("google_reviews_link"::varchar(1000));`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "hotel" alter column "google_maps_link" type varchar(500) using ("google_maps_link"::varchar(500));`, - ); - this.addSql( - `alter table "hotel" alter column "google_maps_embed" type varchar(500) using ("google_maps_embed"::varchar(500));`, - ); - this.addSql( - `alter table "hotel" alter column "google_reviews_link" type varchar(500) using ("google_reviews_link"::varchar(500));`, - ); - } -} diff --git a/src/database/migrations/Migration20251112105017.ts b/src/database/migrations/Migration20251112105017.ts deleted file mode 100644 index 0567012..0000000 --- a/src/database/migrations/Migration20251112105017.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251112105017 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_image" alter column "hotel_id" type varchar(30) using ("hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "hotel_image" alter column "hotel_id" drop not null;`, - ); - this.addSql( - `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on delete cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_image" alter column "hotel_id" type varchar(30) using ("hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "hotel_image" alter column "hotel_id" set not null;`, - ); - this.addSql( - `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251112105413.ts b/src/database/migrations/Migration20251112105413.ts deleted file mode 100644 index e09c5ad..0000000 --- a/src/database/migrations/Migration20251112105413.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251112105413 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "transportation_image" drop constraint "transportation_image_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_image" alter column "transportation_id" type varchar(30) using ("transportation_id"::varchar(30));`, - ); - this.addSql( - `alter table "transportation_image" alter column "transportation_id" drop not null;`, - ); - this.addSql( - `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on delete cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "transportation_image" drop constraint "transportation_image_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_image" alter column "transportation_id" type varchar(30) using ("transportation_id"::varchar(30));`, - ); - this.addSql( - `alter table "transportation_image" alter column "transportation_id" set not null;`, - ); - this.addSql( - `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251112134446.ts b/src/database/migrations/Migration20251112134446.ts deleted file mode 100644 index 9dec5bd..0000000 --- a/src/database/migrations/Migration20251112134446.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251112134446 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_class" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_class" ("id") on update cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251112140208.ts b/src/database/migrations/Migration20251112140208.ts deleted file mode 100644 index a3fea58..0000000 --- a/src/database/migrations/Migration20251112140208.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251112140208 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "package_detail" drop constraint "package_detail_package_itinerary_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" rename column "package_itinerary_id" to "itinerary_id";`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_itinerary_id_foreign" foreign key ("itinerary_id") references "package_itinerary" ("id") on update cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "package_detail" drop constraint "package_detail_itinerary_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" rename column "itinerary_id" to "package_itinerary_id";`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_package_itinerary_id_foreign" foreign key ("package_itinerary_id") references "package_itinerary" ("id") on update cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251113230544.ts b/src/database/migrations/Migration20251113230544.ts deleted file mode 100644 index 1d35cf7..0000000 --- a/src/database/migrations/Migration20251113230544.ts +++ /dev/null @@ -1,283 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251113230544 extends Migration { - override async up(): Promise { - this.addSql( - `alter table "flight_schedule" drop constraint "flight_schedule_next_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary_day" drop constraint "package_itinerary_day_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_day_id_foreign";`, - ); - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_itinerary_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_image" drop constraint "transportation_image_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "flight_schedule" add constraint "flight_schedule_next_id_foreign" foreign key ("next_id") references "flight_schedule" ("id") on delete cascade;`, - ); - - this.addSql( - `alter table "hotel_image" alter column "hotel_id" type varchar(30) using ("hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "hotel_image" alter column "hotel_id" set not null;`, - ); - this.addSql( - `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "package_itinerary_day" add constraint "package_itinerary_day_next_id_foreign" foreign key ("next_id") references "package_itinerary_day" ("id") on delete cascade;`, - ); - - this.addSql( - `alter table "package_itinerary" alter column "day_id" type varchar(30) using ("day_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_itinerary" alter column "day_id" drop not null;`, - ); - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_day_id_foreign" foreign key ("day_id") references "package_itinerary_day" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_next_id_foreign" foreign key ("next_id") references "package_itinerary" ("id") on delete cascade;`, - ); - - this.addSql( - `alter table "package_detail" alter column "tour_flight_id" type varchar(30) using ("tour_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "tour_flight_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "outbound_flight_id" type varchar(30) using ("outbound_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "outbound_flight_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "inbound_flight_id" type varchar(30) using ("inbound_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "inbound_flight_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "makkah_hotel_id" type varchar(30) using ("makkah_hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "makkah_hotel_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "madinah_hotel_id" type varchar(30) using ("madinah_hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "madinah_hotel_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "itinerary_id" type varchar(30) using ("itinerary_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "itinerary_id" drop not null;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_schedule" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_schedule" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_schedule" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel_schedule" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel_schedule" ("id") on delete cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_itinerary_id_foreign" foreign key ("itinerary_id") references "package_itinerary" ("id") on delete cascade;`, - ); - - this.addSql( - `alter table "transportation_image" alter column "transportation_id" type varchar(30) using ("transportation_id"::varchar(30));`, - ); - this.addSql( - `alter table "transportation_image" alter column "transportation_id" set not null;`, - ); - this.addSql( - `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "flight_schedule" drop constraint "flight_schedule_next_id_foreign";`, - ); - - this.addSql( - `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary_day" drop constraint "package_itinerary_day_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_day_id_foreign";`, - ); - this.addSql( - `alter table "package_itinerary" drop constraint "package_itinerary_next_id_foreign";`, - ); - - this.addSql( - `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, - ); - this.addSql( - `alter table "package_detail" drop constraint "package_detail_itinerary_id_foreign";`, - ); - - this.addSql( - `alter table "transportation_image" drop constraint "transportation_image_transportation_id_foreign";`, - ); - - this.addSql( - `alter table "flight_schedule" add constraint "flight_schedule_next_id_foreign" foreign key ("next_id") references "flight_schedule" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "hotel_image" alter column "hotel_id" type varchar(30) using ("hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "hotel_image" alter column "hotel_id" drop not null;`, - ); - this.addSql( - `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on delete cascade;`, - ); - - this.addSql( - `alter table "package_itinerary_day" add constraint "package_itinerary_day_next_id_foreign" foreign key ("next_id") references "package_itinerary_day" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "package_itinerary" alter column "day_id" type varchar(30) using ("day_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_itinerary" alter column "day_id" set not null;`, - ); - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_day_id_foreign" foreign key ("day_id") references "package_itinerary_day" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_itinerary" add constraint "package_itinerary_next_id_foreign" foreign key ("next_id") references "package_itinerary" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "package_detail" alter column "tour_flight_id" type varchar(30) using ("tour_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "tour_flight_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "outbound_flight_id" type varchar(30) using ("outbound_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "outbound_flight_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "inbound_flight_id" type varchar(30) using ("inbound_flight_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "inbound_flight_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "makkah_hotel_id" type varchar(30) using ("makkah_hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "makkah_hotel_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "madinah_hotel_id" type varchar(30) using ("madinah_hotel_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "madinah_hotel_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" alter column "itinerary_id" type varchar(30) using ("itinerary_id"::varchar(30));`, - ); - this.addSql( - `alter table "package_detail" alter column "itinerary_id" set not null;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel_schedule" ("id") on update cascade;`, - ); - this.addSql( - `alter table "package_detail" add constraint "package_detail_itinerary_id_foreign" foreign key ("itinerary_id") references "package_itinerary" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "transportation_image" alter column "transportation_id" type varchar(30) using ("transportation_id"::varchar(30));`, - ); - this.addSql( - `alter table "transportation_image" alter column "transportation_id" drop not null;`, - ); - this.addSql( - `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on delete cascade;`, - ); - } -} diff --git a/src/database/migrations/Migration20251119103455.ts b/src/database/migrations/Migration20251119103455.ts deleted file mode 100644 index a0934ed..0000000 --- a/src/database/migrations/Migration20251119103455.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { Migration } from "@mikro-orm/migrations"; - -export class Migration20251119103455 extends Migration { - override async up(): Promise { - this.addSql( - `create type "skytrax_type" as enum ('full_service', 'low_cost');`, - ); - this.addSql(`create type "package_type" as enum ('reguler', 'plus');`); - this.addSql( - `create type "package_class" as enum ('silver', 'gold', 'platinum');`, - ); - this.addSql( - `create type "package_itinerary_widget_type" as enum ('hotel', 'information', 'transport');`, - ); - this.addSql( - `create type "verification_type" as enum ('admin:create', 'admin:changeEmail', 'admin:changePassword', 'admin:update', 'partner:create', 'partner:changeEmail', 'partner:changePassword', 'partner:update', 'order:create');`, - ); - this.addSql( - `create type "room_type" as enum ('double', 'triple', 'quad', 'infant');`, - ); - this.addSql( - `create type "admin_permission" as enum ('country:create', 'country:update', 'country:delete', 'city:create', 'city:update', 'city:delete', 'airline:create', 'airline:update', 'airline:delete', 'airport:create', 'airport:update', 'airport:delete', 'flight:create', 'flight:update', 'flight:delete', 'flight-class:create', 'flight-class:update', 'flight-class:delete', 'hotel-facility:create', 'hotel-facility:update', 'hotel-facility:delete', 'hotel:create', 'hotel:update', 'hotel:delete', 'transportation:create', 'transportation:update', 'transportation:delete', 'transportation-class:create', 'transportation-class:update', 'transportation-class:delete', 'package:create', 'package:update', 'package:delete', 'package-detail:create', 'package-detail:update', 'package-detail:delete', 'admin:create', 'admin:update', 'admin:delete', 'partner:create', 'partner:update', 'partner:delete');`, - ); - this.addSql( - `create table "verification" ("id" varchar(30) not null, "code" char(6) not null, "type" "verification_type" not null, "expired_at" timestamptz not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "verification_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "partner" ("id" varchar(30) not null, "name" varchar(100) not null, "email" varchar(254) not null, "whatsapp" varchar(20) not null, "password" text not null, "avatar" varchar(100) null, "verification_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "partner_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "partner" add constraint "partner_email_unique" unique ("email");`, - ); - this.addSql( - `alter table "partner" add constraint "partner_whatsapp_unique" unique ("whatsapp");`, - ); - - this.addSql( - `create table "order" ("id" varchar(30) not null, "package_id" varchar(30) not null, "name" varchar(100) not null, "whatsapp" varchar(20) not null, "verification_id" varchar(30) null, "partner_id" varchar(30) null, "expired_at" timestamptz null, "purchased_at" timestamptz null, "finished_at" timestamptz null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "order_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "order_detail" ("id" varchar(30) not null, "order_id" varchar(30) not null, "room_type" "room_type" not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "order_detail_pkey" primary key ("id"));`, - ); - - this.addSql( - `create table "admin" ("id" varchar(30) not null, "name" varchar(100) not null, "email" varchar(254) not null, "password" text not null, "avatar" varchar(100) null, "permissions" "admin_permission"[] not null, "verification_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "admin_pkey" primary key ("id"));`, - ); - this.addSql( - `alter table "admin" add constraint "admin_email_unique" unique ("email");`, - ); - - this.addSql( - `alter table "partner" add constraint "partner_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "order" add constraint "order_package_id_foreign" foreign key ("package_id") references "package_detail" ("id") on update cascade;`, - ); - this.addSql( - `alter table "order" add constraint "order_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, - ); - this.addSql( - `alter table "order" add constraint "order_partner_id_foreign" foreign key ("partner_id") references "partner" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "order_detail" add constraint "order_detail_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade;`, - ); - - this.addSql( - `alter table "admin" add constraint "admin_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, - ); - - this.addSql( - `alter table "airline" drop constraint if exists "airline_skytrax_type_check";`, - ); - - this.addSql( - `alter table "package" drop constraint if exists "package_type_check";`, - ); - this.addSql( - `alter table "package" drop constraint if exists "package_class_check";`, - ); - - this.addSql( - `alter table "package_itinerary_widget" drop constraint if exists "package_itinerary_widget_type_check";`, - ); - - this.addSql(`alter table "airline" drop constraint "airline_logo_unique";`); - - this.addSql( - `alter table "airline" alter column "skytrax_type" type "skytrax_type" using ("skytrax_type"::"skytrax_type");`, - ); - - this.addSql( - `alter table "package" drop constraint "package_thumbnail_unique";`, - ); - - this.addSql( - `alter table "package" alter column "type" type "package_type" using ("type"::"package_type");`, - ); - this.addSql( - `alter table "package" alter column "class" type "package_class" using ("class"::"package_class");`, - ); - - this.addSql( - `alter table "package_itinerary_widget" alter column "type" type "package_itinerary_widget_type" using ("type"::"package_itinerary_widget_type");`, - ); - } - - override async down(): Promise { - this.addSql( - `alter table "partner" drop constraint "partner_verification_id_foreign";`, - ); - - this.addSql( - `alter table "order" drop constraint "order_verification_id_foreign";`, - ); - - this.addSql( - `alter table "admin" drop constraint "admin_verification_id_foreign";`, - ); - - this.addSql( - `alter table "order" drop constraint "order_partner_id_foreign";`, - ); - - this.addSql( - `alter table "order_detail" drop constraint "order_detail_order_id_foreign";`, - ); - - this.addSql(`drop table if exists "verification" cascade;`); - - this.addSql(`drop table if exists "partner" cascade;`); - - this.addSql(`drop table if exists "order" cascade;`); - - this.addSql(`drop table if exists "order_detail" cascade;`); - - this.addSql(`drop table if exists "admin" cascade;`); - - this.addSql( - `alter table "airline" alter column "skytrax_type" type text using ("skytrax_type"::text);`, - ); - this.addSql( - `alter table "airline" add constraint "airline_skytrax_type_check" check("skytrax_type" in ('full_service', 'low_cost'));`, - ); - this.addSql( - `alter table "airline" add constraint "airline_logo_unique" unique ("logo");`, - ); - - this.addSql( - `alter table "package" alter column "type" type text using ("type"::text);`, - ); - this.addSql( - `alter table "package" alter column "class" type text using ("class"::text);`, - ); - this.addSql( - `alter table "package" add constraint "package_type_check" check("type" in ('reguler', 'plus'));`, - ); - this.addSql( - `alter table "package" add constraint "package_class_check" check("class" in ('silver', 'gold', 'platinum'));`, - ); - this.addSql( - `alter table "package" add constraint "package_thumbnail_unique" unique ("thumbnail");`, - ); - - this.addSql( - `alter table "package_itinerary_widget" alter column "type" type text using ("type"::text);`, - ); - this.addSql( - `alter table "package_itinerary_widget" add constraint "package_itinerary_widget_type_check" check("type" in ('transport', 'hotel', 'information'));`, - ); - - this.addSql(`drop type "skytrax_type";`); - this.addSql(`drop type "package_type";`); - this.addSql(`drop type "package_class";`); - this.addSql(`drop type "package_itinerary_widget_type";`); - this.addSql(`drop type "verification_type";`); - this.addSql(`drop type "room_type";`); - this.addSql(`drop type "admin_permission";`); - } -} diff --git a/src/database/migrations/Migration20251130032813.ts b/src/database/migrations/Migration20251130032813.ts new file mode 100644 index 0000000..bc55aa4 --- /dev/null +++ b/src/database/migrations/Migration20251130032813.ts @@ -0,0 +1,490 @@ +import { Migration } from "@mikro-orm/migrations"; + +export class Migration20251130032813 extends Migration { + override async up(): Promise { + this.addSql( + `create type "skytrax_type" as enum ('full_service', 'low_cost');`, + ); + this.addSql(`create type "package_type" as enum ('reguler', 'plus');`); + this.addSql( + `create type "package_class" as enum ('silver', 'gold', 'platinum');`, + ); + this.addSql( + `create type "package_itinerary_widget_type" as enum ('hotel', 'information', 'transport');`, + ); + this.addSql( + `create type "verification_type" as enum ('admin:create', 'admin:changeEmail', 'admin:changePassword', 'admin:update', 'partner:create', 'partner:changeEmail', 'partner:changePassword', 'partner:update', 'order:create');`, + ); + this.addSql( + `create type "room_type" as enum ('double', 'triple', 'quad', 'infant');`, + ); + this.addSql( + `create type "admin_permission" as enum ('country:create', 'country:update', 'country:delete', 'city:create', 'city:update', 'city:delete', 'airline:create', 'airline:update', 'airline:delete', 'airport:create', 'airport:update', 'airport:delete', 'flight:create', 'flight:update', 'flight:delete', 'flight-class:create', 'flight-class:update', 'flight-class:delete', 'hotel-facility:create', 'hotel-facility:update', 'hotel-facility:delete', 'hotel:create', 'hotel:update', 'hotel:delete', 'transportation:create', 'transportation:update', 'transportation:delete', 'transportation-class:create', 'transportation-class:update', 'transportation-class:delete', 'package:create', 'package:update', 'package:delete', 'package-detail:create', 'package-detail:update', 'package-detail:delete', 'admin:create', 'admin:update', 'admin:delete', 'partner:create', 'partner:update', 'partner:delete');`, + ); + this.addSql( + `create table "airline" ("id" varchar(30) not null, "name" varchar(100) not null, "code" varchar(10) not null, "logo" varchar(100) not null, "skytrax_rating" int not null, "skytrax_type" "skytrax_type" not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "airline_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "airline" add constraint "airline_code_unique" unique ("code");`, + ); + + this.addSql( + `create table "country" ("id" varchar(30) not null, "name" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "country_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "city" ("id" varchar(30) not null, "name" varchar(100) not null, "country_id" varchar(30) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "city_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "airport" ("id" varchar(30) not null, "name" varchar(100) not null, "code" varchar(10) not null, "city_id" varchar(30) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "airport_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "airport" add constraint "airport_code_unique" unique ("code");`, + ); + + this.addSql( + `create table "flight" ("id" varchar(30) not null, "airline_id" varchar(30) not null, "number" int not null, "departure_airport_id" varchar(30) not null, "departure_terminal" varchar(100) null, "departure_gate" varchar(100) null, "departure_time" time(0) not null, "arrival_airport_id" varchar(30) not null, "arrival_terminal" varchar(100) null, "arrival_gate" varchar(100) null, "duration" int not null, "aircraft" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "flight" add constraint "flight_airline_id_number_unique" unique ("airline_id", "number");`, + ); + + this.addSql( + `create table "flight_class" ("id" varchar(30) not null, "flight_id" varchar(30) not null, "class" varchar(100) not null, "seat_layout" varchar(10) not null, "baggage" int not null, "cabin_baggage" int not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_class_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "flight_class" add constraint "flight_class_flight_id_class_unique" unique ("flight_id", "class");`, + ); + + this.addSql( + `create table "flight_schedule" ("id" varchar(30) not null, "flight_id" varchar(30) not null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "flight_schedule_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "hotel" ("id" varchar(30) not null, "name" varchar(100) not null, "city_id" varchar(30) not null, "star" int not null, "google_maps_link" varchar(1000) not null, "google_maps_embed" varchar(1000) not null, "google_reviews_link" varchar(1000) not null, "description" varchar(1000) not null, "address" varchar(100) not null, "landmark" varchar(100) not null, "distance_to_landmark" numeric(10,0) not null, "food_type" varchar(100) not null, "food_amount" int not null, "food_menu" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "hotel_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "hotel_facility" ("id" varchar(30) not null, "name" varchar(100) not null, "icon" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "hotel_facility_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "hotel_facilities" ("hotel_id" varchar(30) not null, "hotel_facility_id" varchar(30) not null, constraint "hotel_facilities_pkey" primary key ("hotel_id", "hotel_facility_id"));`, + ); + + this.addSql( + `create table "hotel_image" ("id" varchar(30) not null, "hotel_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "hotel_image_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "package" ("id" varchar(30) not null, "name" varchar(100) not null, "type" "package_type" not null, "class" "package_class" not null, "thumbnail" varchar(100) not null, "use_fast_train" boolean not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "package_itinerary_day" ("id" varchar(30) not null, "title" varchar(100) not null, "description" varchar(1000) not null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_itinerary_day_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "package_itinerary" ("id" varchar(30) not null, "location" varchar(100) not null, "day_id" varchar(30) null, "next_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_itinerary_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "package_itinerary_image" ("id" varchar(30) not null, "package_itinerary_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "package_itinerary_image_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "package_itinerary_widget" ("id" varchar(30) not null, "package_itinerary_day_id" varchar(30) not null, "type" "package_itinerary_widget_type" not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "hotel_id" varchar(30) null, "description" varchar(1000) null, "transportation" varchar(100) null, "from" varchar(100) null, "to" varchar(100) null, constraint "package_itinerary_widget_pkey" primary key ("id"));`, + ); + this.addSql( + `create index "package_itinerary_widget_type_index" on "package_itinerary_widget" ("type");`, + ); + + this.addSql( + `create table "transportation" ("id" varchar(30) not null, "name" varchar(100) not null, "type" varchar(100) not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "transportation_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "transportation_class" ("id" varchar(30) not null, "transportation_id" varchar(30) not null, "class" varchar(100) not null, "total_seats" int not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "transportation_class_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "transportation_class" add constraint "transportation_class_transportation_id_class_unique" unique ("transportation_id", "class");`, + ); + + this.addSql( + `create table "package_detail" ("id" varchar(30) not null, "package_id" varchar(30) not null, "departure_date" date not null, "tour_flight_id" varchar(30) null, "outbound_flight_id" varchar(30) null, "inbound_flight_id" varchar(30) null, "makkah_hotel_id" varchar(30) null, "madinah_hotel_id" varchar(30) null, "transportation_id" varchar(30) not null, "quad_price" numeric(10,0) not null, "triple_price" numeric(10,0) not null, "double_price" numeric(10,0) not null, "infant_price" numeric(10,0) null, "itinerary_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "package_detail_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_package_id_departure_date_unique" unique ("package_id", "departure_date");`, + ); + + this.addSql( + `create table "package_detail_tour_hotels" ("package_detail_id" varchar(30) not null, "hotel_id" varchar(30) not null, constraint "package_detail_tour_hotels_pkey" primary key ("package_detail_id", "hotel_id"));`, + ); + + this.addSql( + `create table "transportation_image" ("id" varchar(30) not null, "transportation_id" varchar(30) not null, "src" varchar(100) not null, "created_at" varchar(100) not null, "updated_at" timestamptz not null, constraint "transportation_image_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "verification" ("id" varchar(30) not null, "code" char(6) not null, "type" "verification_type" not null, "expired_at" timestamptz not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "verification_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "partner" ("id" varchar(30) not null, "name" varchar(100) not null, "email" varchar(254) not null, "whatsapp" varchar(20) not null, "password" text not null, "avatar" varchar(100) null, "verification_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "partner_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "partner" add constraint "partner_email_unique" unique ("email");`, + ); + this.addSql( + `alter table "partner" add constraint "partner_whatsapp_unique" unique ("whatsapp");`, + ); + + this.addSql( + `create table "order" ("id" varchar(30) not null, "package_id" varchar(30) not null, "name" varchar(100) not null, "whatsapp" varchar(20) not null, "verification_id" varchar(30) null, "partner_id" varchar(30) null, "expired_at" timestamptz null, "purchased_at" timestamptz null, "finished_at" timestamptz null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "order_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "order_detail" ("id" varchar(30) not null, "order_id" varchar(30) not null, "room_type" "room_type" not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "order_detail_pkey" primary key ("id"));`, + ); + + this.addSql( + `create table "admin" ("id" varchar(30) not null, "name" varchar(100) not null, "email" varchar(254) not null, "password" text not null, "avatar" varchar(100) null, "permissions" "admin_permission"[] not null, "verification_id" varchar(30) null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "admin_pkey" primary key ("id"));`, + ); + this.addSql( + `alter table "admin" add constraint "admin_email_unique" unique ("email");`, + ); + + this.addSql( + `alter table "city" add constraint "city_country_id_foreign" foreign key ("country_id") references "country" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "airport" add constraint "airport_city_id_foreign" foreign key ("city_id") references "city" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "flight" add constraint "flight_airline_id_foreign" foreign key ("airline_id") references "airline" ("id") on update cascade;`, + ); + this.addSql( + `alter table "flight" add constraint "flight_departure_airport_id_foreign" foreign key ("departure_airport_id") references "airport" ("id") on update cascade;`, + ); + this.addSql( + `alter table "flight" add constraint "flight_arrival_airport_id_foreign" foreign key ("arrival_airport_id") references "airport" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "flight_class" add constraint "flight_class_flight_id_foreign" foreign key ("flight_id") references "flight" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "flight_schedule" add constraint "flight_schedule_flight_id_foreign" foreign key ("flight_id") references "flight_class" ("id") on update cascade;`, + ); + this.addSql( + `alter table "flight_schedule" add constraint "flight_schedule_next_id_foreign" foreign key ("next_id") references "flight_schedule" ("id") on delete cascade;`, + ); + + this.addSql( + `alter table "hotel" add constraint "hotel_city_id_foreign" foreign key ("city_id") references "city" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "hotel_facilities" add constraint "hotel_facilities_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete cascade;`, + ); + this.addSql( + `alter table "hotel_facilities" add constraint "hotel_facilities_hotel_facility_id_foreign" foreign key ("hotel_facility_id") references "hotel_facility" ("id") on update cascade on delete cascade;`, + ); + + this.addSql( + `alter table "hotel_image" add constraint "hotel_image_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "package_itinerary_day" add constraint "package_itinerary_day_next_id_foreign" foreign key ("next_id") references "package_itinerary_day" ("id") on delete cascade;`, + ); + + this.addSql( + `alter table "package_itinerary" add constraint "package_itinerary_day_id_foreign" foreign key ("day_id") references "package_itinerary_day" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_itinerary" add constraint "package_itinerary_next_id_foreign" foreign key ("next_id") references "package_itinerary" ("id") on delete cascade;`, + ); + + this.addSql( + `alter table "package_itinerary_image" add constraint "package_itinerary_image_package_itinerary_id_foreign" foreign key ("package_itinerary_id") references "package_itinerary" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "package_itinerary_widget" add constraint "package_itinerary_widget_package_itinerary_day_id_foreign" foreign key ("package_itinerary_day_id") references "package_itinerary_day" ("id") on update cascade;`, + ); + this.addSql( + `alter table "package_itinerary_widget" add constraint "package_itinerary_widget_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete set null;`, + ); + + this.addSql( + `alter table "transportation_class" add constraint "transportation_class_transportation_id_foreign" foreign key ("transportation_id") references "transportation" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "package_detail" add constraint "package_detail_package_id_foreign" foreign key ("package_id") references "package" ("id") on update cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_tour_flight_id_foreign" foreign key ("tour_flight_id") references "flight_schedule" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_outbound_flight_id_foreign" foreign key ("outbound_flight_id") references "flight_schedule" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_inbound_flight_id_foreign" foreign key ("inbound_flight_id") references "flight_schedule" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_makkah_hotel_id_foreign" foreign key ("makkah_hotel_id") references "hotel" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_madinah_hotel_id_foreign" foreign key ("madinah_hotel_id") references "hotel" ("id") on delete cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, + ); + this.addSql( + `alter table "package_detail" add constraint "package_detail_itinerary_id_foreign" foreign key ("itinerary_id") references "package_itinerary" ("id") on delete cascade;`, + ); + + this.addSql( + `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_package_detail_id_foreign" foreign key ("package_detail_id") references "package_detail" ("id") on update cascade on delete cascade;`, + ); + this.addSql( + `alter table "package_detail_tour_hotels" add constraint "package_detail_tour_hotels_hotel_id_foreign" foreign key ("hotel_id") references "hotel" ("id") on update cascade on delete cascade;`, + ); + + this.addSql( + `alter table "transportation_image" add constraint "transportation_image_transportation_id_foreign" foreign key ("transportation_id") references "transportation_class" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "partner" add constraint "partner_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, + ); + + this.addSql( + `alter table "order" add constraint "order_package_id_foreign" foreign key ("package_id") references "package_detail" ("id") on update cascade;`, + ); + this.addSql( + `alter table "order" add constraint "order_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, + ); + this.addSql( + `alter table "order" add constraint "order_partner_id_foreign" foreign key ("partner_id") references "partner" ("id") on update cascade on delete set null;`, + ); + + this.addSql( + `alter table "order_detail" add constraint "order_detail_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade;`, + ); + + this.addSql( + `alter table "admin" add constraint "admin_verification_id_foreign" foreign key ("verification_id") references "verification" ("id") on update cascade on delete set null;`, + ); + } + + override async down(): Promise { + this.addSql( + `alter table "flight" drop constraint "flight_airline_id_foreign";`, + ); + + this.addSql( + `alter table "city" drop constraint "city_country_id_foreign";`, + ); + + this.addSql( + `alter table "airport" drop constraint "airport_city_id_foreign";`, + ); + + this.addSql(`alter table "hotel" drop constraint "hotel_city_id_foreign";`); + + this.addSql( + `alter table "flight" drop constraint "flight_departure_airport_id_foreign";`, + ); + + this.addSql( + `alter table "flight" drop constraint "flight_arrival_airport_id_foreign";`, + ); + + this.addSql( + `alter table "flight_class" drop constraint "flight_class_flight_id_foreign";`, + ); + + this.addSql( + `alter table "flight_schedule" drop constraint "flight_schedule_flight_id_foreign";`, + ); + + this.addSql( + `alter table "flight_schedule" drop constraint "flight_schedule_next_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_tour_flight_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_outbound_flight_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_inbound_flight_id_foreign";`, + ); + + this.addSql( + `alter table "hotel_facilities" drop constraint "hotel_facilities_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "hotel_image" drop constraint "hotel_image_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary_widget" drop constraint "package_itinerary_widget_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_makkah_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_madinah_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_hotel_id_foreign";`, + ); + + this.addSql( + `alter table "hotel_facilities" drop constraint "hotel_facilities_hotel_facility_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_package_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary_day" drop constraint "package_itinerary_day_next_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary" drop constraint "package_itinerary_day_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary_widget" drop constraint "package_itinerary_widget_package_itinerary_day_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary" drop constraint "package_itinerary_next_id_foreign";`, + ); + + this.addSql( + `alter table "package_itinerary_image" drop constraint "package_itinerary_image_package_itinerary_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_itinerary_id_foreign";`, + ); + + this.addSql( + `alter table "transportation_class" drop constraint "transportation_class_transportation_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail" drop constraint "package_detail_transportation_id_foreign";`, + ); + + this.addSql( + `alter table "transportation_image" drop constraint "transportation_image_transportation_id_foreign";`, + ); + + this.addSql( + `alter table "package_detail_tour_hotels" drop constraint "package_detail_tour_hotels_package_detail_id_foreign";`, + ); + + this.addSql( + `alter table "order" drop constraint "order_package_id_foreign";`, + ); + + this.addSql( + `alter table "partner" drop constraint "partner_verification_id_foreign";`, + ); + + this.addSql( + `alter table "order" drop constraint "order_verification_id_foreign";`, + ); + + this.addSql( + `alter table "admin" drop constraint "admin_verification_id_foreign";`, + ); + + this.addSql( + `alter table "order" drop constraint "order_partner_id_foreign";`, + ); + + this.addSql( + `alter table "order_detail" drop constraint "order_detail_order_id_foreign";`, + ); + + this.addSql(`drop table if exists "airline" cascade;`); + + this.addSql(`drop table if exists "country" cascade;`); + + this.addSql(`drop table if exists "city" cascade;`); + + this.addSql(`drop table if exists "airport" cascade;`); + + this.addSql(`drop table if exists "flight" cascade;`); + + this.addSql(`drop table if exists "flight_class" cascade;`); + + this.addSql(`drop table if exists "flight_schedule" cascade;`); + + this.addSql(`drop table if exists "hotel" cascade;`); + + this.addSql(`drop table if exists "hotel_facility" cascade;`); + + this.addSql(`drop table if exists "hotel_facilities" cascade;`); + + this.addSql(`drop table if exists "hotel_image" cascade;`); + + this.addSql(`drop table if exists "package" cascade;`); + + this.addSql(`drop table if exists "package_itinerary_day" cascade;`); + + this.addSql(`drop table if exists "package_itinerary" cascade;`); + + this.addSql(`drop table if exists "package_itinerary_image" cascade;`); + + this.addSql(`drop table if exists "package_itinerary_widget" cascade;`); + + this.addSql(`drop table if exists "transportation" cascade;`); + + this.addSql(`drop table if exists "transportation_class" cascade;`); + + this.addSql(`drop table if exists "package_detail" cascade;`); + + this.addSql(`drop table if exists "package_detail_tour_hotels" cascade;`); + + this.addSql(`drop table if exists "transportation_image" cascade;`); + + this.addSql(`drop table if exists "verification" cascade;`); + + this.addSql(`drop table if exists "partner" cascade;`); + + this.addSql(`drop table if exists "order" cascade;`); + + this.addSql(`drop table if exists "order_detail" cascade;`); + + this.addSql(`drop table if exists "admin" cascade;`); + + this.addSql(`drop type "skytrax_type";`); + this.addSql(`drop type "package_type";`); + this.addSql(`drop type "package_class";`); + this.addSql(`drop type "package_itinerary_widget_type";`); + this.addSql(`drop type "verification_type";`); + this.addSql(`drop type "room_type";`); + this.addSql(`drop type "admin_permission";`); + } +}