Explorar el Código

set access permissions to allow backup

Pi hace 6 meses
padre
commit
e03c205c71

+ 1 - 9
sqlpage/sqlpage/data/products.sql

@@ -1,14 +1,5 @@
 DROP TABLE IF EXISTS sqlpage_products;
 CREATE TABLE IF NOT EXISTS sqlpage_products AS
---(
---   "Products" int,
---   "Categories" int,
---   "Groups" int,
---   product text,
---   category text,
---   "group" text
--- );
---INSERT INTO sqlpage_products
 SELECT
   count(DISTINCT p.id) AS "Products",
   count(DISTINCT c.id) AS "Categories",
@@ -27,3 +18,4 @@ AND
   (g.name IN (SELECT v#>>'{}' FROM json_array_elements($groups::json) j(v)) OR $groups IS NULL)
 GROUP BY ROLLUP ("group", category, product)
 ;
+GRANT SELECT ON sqlpage_products TO PUBLIC;

+ 2 - 1
sqlpage/sqlpage/data/tags.sql

@@ -20,4 +20,5 @@ AND
   BETWEEN $start::date AND $end::date
 GROUP BY tg.name
 ORDER BY 1 DESC, 2
-;
+;
+GRANT SELECT ON sqlpage_tags TO PUBLIC;

+ 2 - 1
sqlpage/sqlpage/data/transactions.sql

@@ -52,4 +52,5 @@ AND
     )
   ) OR $tags IS NULL)
 ORDER BY ts DESC
-LIMIT 1000);
+LIMIT 1000);
+GRANT SELECT ON sqlpage_txn TO PUBLIC;

+ 2 - 1
sqlpage/sqlpage/data/units.sql

@@ -2,4 +2,5 @@ DROP TABLE IF EXISTS sqlpage_units;
 CREATE TABLE IF NOT EXISTS sqlpage_units AS
 SELECT u.name, ut.name AS type FROM units u
 JOIN unit_types ut ON ut.id = u.unit_type_id
-;
+;
+GRANT SELECT ON sqlpage_units TO PUBLIC;