Explorar o código

feat(db): add days in year function

vtugulan hai 4 días
pai
achega
584b98c409

+ 7 - 0
prisma/migrations/20260202123456_add_days_in_year_function/migration.sql

@@ -0,0 +1,7 @@
+-- Create function days_in_year
+CREATE OR REPLACE FUNCTION days_in_year(year double precision)
+RETURNS integer
+LANGUAGE sql
+BEGIN ATOMIC
+    SELECT EXTRACT(day FROM ((concat('01/01/', (year + (1)::double precision)))::timestamp without time zone - (concat('01/01/', year))::timestamp without time zone)) AS "extract";
+END;

+ 3 - 0
prisma/migrations/20260202123456_add_days_in_year_function/migration_lock.toml

@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (e.g., Git)
+provider = "postgresql"