2019-08-30 11:06:36 -04:00
|
|
|
--Storing as json b, create column defined as jsonb
|
|
|
|
--This contains the award name and award year
|
2019-08-30 08:17:21 -04:00
|
|
|
ALTER TABLE buildings
|
2019-08-30 11:06:36 -04:00
|
|
|
ADD COLUMN IF NOT EXISTS team_awards jsonb;
|
2019-08-15 10:08:02 -04:00
|
|
|
|
2023-01-04 07:17:56 -05:00
|
|
|
--To validate this input, the following confirms it's an valid object but not that the items in the object are validated against those we will accept
|
2019-08-30 08:17:21 -04:00
|
|
|
ALTER TABLE buildings
|
2019-08-30 11:06:36 -04:00
|
|
|
ADD CONSTRAINT data_is_valid CHECK (is_jsonb_valid ('{"type": "object"}', team_awards));
|