Skip to content

Commit 61319aa

Browse files
committed
Refactor SQL tests to use NOW() instead of now() for consistency
- Updated multiple test files to replace instances of 'now()' with 'NOW()' for better readability and consistency across SQL test scripts. - Ensured that all date and time references in the tests reflect the same function for retrieving the current timestamp.
1 parent 19cb3ca commit 61319aa

File tree

56 files changed

+2597
-1335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2597
-1335
lines changed

planetscale/schema_replicate.sql

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ $$;
102102

103103
CREATE TABLE public.app_versions (
104104
id bigint NOT NULL,
105-
created_at timestamp with time zone DEFAULT now(),
105+
created_at timestamp with time zone DEFAULT NOW(),
106106
app_id character varying NOT NULL,
107107
name character varying NOT NULL,
108-
updated_at timestamp with time zone DEFAULT now(),
108+
updated_at timestamp with time zone DEFAULT NOW(),
109109
deleted boolean DEFAULT false NOT NULL,
110110
external_url character varying,
111111
checksum character varying,
@@ -146,7 +146,7 @@ ALTER TABLE public.app_versions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDEN
146146
--
147147

148148
CREATE TABLE public.apps (
149-
created_at timestamp with time zone DEFAULT now(),
149+
created_at timestamp with time zone DEFAULT NOW(),
150150
app_id character varying NOT NULL,
151151
icon_url character varying NOT NULL,
152152
user_id uuid,
@@ -171,10 +171,10 @@ ALTER TABLE ONLY public.apps REPLICA IDENTITY FULL;
171171
--
172172

173173
CREATE TABLE public.channel_devices (
174-
created_at timestamp with time zone DEFAULT now(),
174+
created_at timestamp with time zone DEFAULT NOW(),
175175
channel_id bigint NOT NULL,
176176
app_id character varying NOT NULL,
177-
updated_at timestamp with time zone DEFAULT now() NOT NULL,
177+
updated_at timestamp with time zone DEFAULT NOW() NOT NULL,
178178
device_id text NOT NULL,
179179
id bigint NOT NULL,
180180
owner_org uuid NOT NULL
@@ -203,11 +203,11 @@ ALTER TABLE public.channel_devices ALTER COLUMN id ADD GENERATED BY DEFAULT AS I
203203

204204
CREATE TABLE public.channels (
205205
id bigint NOT NULL,
206-
created_at timestamp with time zone DEFAULT now() NOT NULL,
206+
created_at timestamp with time zone DEFAULT NOW() NOT NULL,
207207
name character varying NOT NULL,
208208
app_id character varying NOT NULL,
209209
version bigint NOT NULL,
210-
updated_at timestamp with time zone DEFAULT now() NOT NULL,
210+
updated_at timestamp with time zone DEFAULT NOW() NOT NULL,
211211
public boolean DEFAULT false NOT NULL,
212212
disable_auto_update_under_native boolean DEFAULT true NOT NULL,
213213
ios boolean DEFAULT true NOT NULL,
@@ -282,8 +282,8 @@ ALTER SEQUENCE public.manifest_id_seq OWNED BY public.manifest.id;
282282

283283
CREATE TABLE public.org_users (
284284
id bigint NOT NULL,
285-
created_at timestamp with time zone DEFAULT now(),
286-
updated_at timestamp with time zone DEFAULT now(),
285+
created_at timestamp with time zone DEFAULT NOW(),
286+
updated_at timestamp with time zone DEFAULT NOW(),
287287
user_id uuid NOT NULL,
288288
org_id uuid NOT NULL,
289289
app_id character varying,
@@ -313,8 +313,8 @@ ALTER TABLE public.org_users ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTIT
313313
CREATE TABLE public.orgs (
314314
id uuid DEFAULT gen_random_uuid() NOT NULL,
315315
created_by uuid NOT NULL,
316-
created_at timestamp with time zone DEFAULT now(),
317-
updated_at timestamp with time zone DEFAULT now(),
316+
created_at timestamp with time zone DEFAULT NOW(),
317+
updated_at timestamp with time zone DEFAULT NOW(),
318318
logo text,
319319
name text NOT NULL,
320320
management_email text NOT NULL,
@@ -337,18 +337,18 @@ ALTER TABLE ONLY public.orgs REPLICA IDENTITY FULL;
337337
--
338338

339339
CREATE TABLE public.stripe_info (
340-
created_at timestamp with time zone DEFAULT now() NOT NULL,
341-
updated_at timestamp with time zone DEFAULT now() NOT NULL,
340+
created_at timestamp with time zone DEFAULT NOW() NOT NULL,
341+
updated_at timestamp with time zone DEFAULT NOW() NOT NULL,
342342
subscription_id character varying,
343343
customer_id character varying NOT NULL,
344344
status public.stripe_status,
345345
product_id character varying NOT NULL,
346-
trial_at timestamp with time zone DEFAULT now() NOT NULL,
346+
trial_at timestamp with time zone DEFAULT NOW() NOT NULL,
347347
price_id character varying,
348348
is_good_plan boolean DEFAULT true,
349349
plan_usage bigint DEFAULT '0'::bigint,
350350
subscription_metered json DEFAULT '{}'::json NOT NULL,
351-
subscription_anchor_start timestamp with time zone DEFAULT now() NOT NULL,
351+
subscription_anchor_start timestamp with time zone DEFAULT NOW() NOT NULL,
352352
subscription_anchor_end timestamp with time zone DEFAULT public.one_month_ahead() NOT NULL,
353353
canceled_at timestamp with time zone,
354354
mau_exceeded boolean DEFAULT false,

0 commit comments

Comments
 (0)