mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-07-31 23:43:01 -05:00
Database: Update embedded schema
This commit is contained in:
parent
2e798b591a
commit
0032fa4350
|
|
@ -25,6 +25,18 @@ func UpdateTables(pool *pgxpool.Pool, ctx context.Context) {
|
|||
|
||||
pool.Exec(ctx, `
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF (SELECT data_type FROM information_schema.columns WHERE table_name='users' AND column_name='ng_device_id') != 'ARRAY' THEN
|
||||
ALTER TABLE public.users
|
||||
ALTER COLUMN ng_device_id TYPE bigint[] using array[ng_device_id];
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
`)
|
||||
|
||||
pool.Exec(ctx, `
|
||||
|
||||
ALTER TABLE ONLY public.mario_kart_wii_sake
|
||||
ADD IF NOT EXISTS id serial PRIMARY KEY,
|
||||
ADD IF NOT EXISTS upload_time timestamp without time zone;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user