Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

776 B
Raw Blame
-- This is an empty migration.
DROP VIEW "ApprovedMarketplaceProduct";

CREATE VIEW "ApprovedMarketplaceProduct" AS
SELECT DISTINCT ON (build."projectId")
  build."projectId",
  build."marketplaceProduct",
  (
    SELECT
      token
    FROM
      "AuthorizationToken" auth
    WHERE
      auth."projectId" = build."projectId" AND
      auth.relation = 'viewers'
    ORDER BY
      auth."token"
    LIMIT 1
  ) AS "authorizationToken"
FROM
  "Build" build
WHERE
  build.deployment IS NOT NULL -- published
  AND build."projectId" IN (
    SELECT
      "id"
    FROM
      "Project"
    WHERE ("isDeleted" = FALSE
      AND "marketplaceApprovalStatus" = CAST('APPROVED'::text AS "MarketplaceApprovalStatus")))
ORDER BY
  build."projectId",
  build."createdAt" DESC,
  build.id;