diff options
Diffstat (limited to 'db/migrations/0085_thankful_medusa.sql')
| -rw-r--r-- | db/migrations/0085_thankful_medusa.sql | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/db/migrations/0085_thankful_medusa.sql b/db/migrations/0085_thankful_medusa.sql new file mode 100644 index 00000000..d07347bb --- /dev/null +++ b/db/migrations/0085_thankful_medusa.sql @@ -0,0 +1,6 @@ +DROP VIEW "public"."contracts_detail_view";--> statement-breakpoint +CREATE VIEW "public"."contracts_detail_view" AS (select "contracts"."id", "contracts"."contract_no", "contracts"."contract_name", "contracts"."status", "contracts"."start_date", "contracts"."end_date", "contracts"."project_id", "projects"."code", "projects"."name", "contracts"."vendor_id", "vendors"."vendor_name", "contracts"."payment_terms", "contracts"."delivery_terms", "contracts"."delivery_date", "contracts"."delivery_location", "contracts"."currency", "contracts"."total_amount", "contracts"."discount", "contracts"."tax", "contracts"."shipping_fee", "contracts"."net_total", "contracts"."partial_shipping_allowed", "contracts"."partial_payment_allowed", "contracts"."remarks", "contracts"."version", "contracts"."created_at", "contracts"."updated_at", EXISTS ( + SELECT 1 + FROM "contract_envelopes" + WHERE "contract_envelopes"."contract_id" = "contracts"."id" + ) as "has_signature" from "contracts" left join "projects" on "contracts"."project_id" = "projects"."id" left join "vendors" on "contracts"."vendor_id" = "vendors"."id");
\ No newline at end of file |
