added updated at to xero connection

This commit is contained in:
Jun-te Kim 2026-01-18 21:20:34 +00:00
parent 04e794fe86
commit cbb4f93cad
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,14 @@
-- 1. Add updated_at as nullable
ALTER TABLE public.xero_connections
ADD COLUMN updated_at TIMESTAMPTZ;
-- 2. Backfill existing rows
UPDATE public.xero_connections
SET updated_at = COALESCE(updated_at, created_at, NOW());
-- 3. Enforce NOT NULL + default
ALTER TABLE public.xero_connections
ALTER COLUMN updated_at SET NOT NULL;
ALTER TABLE public.xero_connections
ALTER COLUMN updated_at SET DEFAULT NOW();

View file

@ -1,4 +1,4 @@
h1:O+cDEObDAwTIbKQ7pT/b6qANyIhLfqzhXZAZTLXaQVo= h1:puaBSJCOfcifcszA+vjE4WU1cp3sP0wp5sAPlcC1+ys=
0001_init.sql h1:gzb02ZbjrrJkXOC+2qIZsngnj7A+29O2/b4awScPlPs= 0001_init.sql h1:gzb02ZbjrrJkXOC+2qIZsngnj7A+29O2/b4awScPlPs=
0002_auth.sql h1:4NhBu26dIBMy9gxMxM3tf6Z2CS2kfKlGjFBj07T/aBw= 0002_auth.sql h1:4NhBu26dIBMy9gxMxM3tf6Z2CS2kfKlGjFBj07T/aBw=
0003_stripe_xero.sql h1:E2bcdUDnondsXwbdIwVlZqR4DQwzcoDiyeRFJwVxXwg= 0003_stripe_xero.sql h1:E2bcdUDnondsXwbdIwVlZqR4DQwzcoDiyeRFJwVxXwg=
@ -8,3 +8,4 @@ h1:O+cDEObDAwTIbKQ7pT/b6qANyIhLfqzhXZAZTLXaQVo=
20260118151944_add_unique_index_to_stripe_accounts.sql h1:PyI8cM8Xyn4bG7BBlD7YRwK1iRQ8HPfzf0r1+Swfe1Y= 20260118151944_add_unique_index_to_stripe_accounts.sql h1:PyI8cM8Xyn4bG7BBlD7YRwK1iRQ8HPfzf0r1+Swfe1Y=
20260118165004_add_unique_for_xero.sql h1:gdsqkAeuGG2SmeCRGEBw39RAAGAoZiF5LF/0HfTBZ0w= 20260118165004_add_unique_for_xero.sql h1:gdsqkAeuGG2SmeCRGEBw39RAAGAoZiF5LF/0HfTBZ0w=
20260118191050_add_more_info_on_xero_for_refresh_token.sql h1:cIQZ81Q7mBX4o8Xb6k3CGSFFw9KoVbZgfYxhOtxxvu4= 20260118191050_add_more_info_on_xero_for_refresh_token.sql h1:cIQZ81Q7mBX4o8Xb6k3CGSFFw9KoVbZgfYxhOtxxvu4=
20260118211854_add_last_updated_at.sql h1:y01AhrpxYmYWIIn9La73twwrfJteCj0r5PovRCiQoh4=