colouring-montreal/migrations/unreleased/0xx.team.up.sql

9 lines
434 B
MySQL
Raw Normal View History

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
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
ALTER TABLE buildings
2019-08-30 11:06:36 -04:00
ADD CONSTRAINT data_is_valid CHECK (is_jsonb_valid ('{"type": "object"}', team_awards));