colouring-montreal/migrations/unreleased/0xx.team.up.sql
Maciej Ziarkowski 37bbf41576 Move WIP migrations to unreleased/ subfolder
Currently, there are migration SQL scripts on the master branch
that have not been released, yet are in the migrations folder.
Although the files have a 0xx number rather than a set number,
this could still lead someone to run the scripts following the
standard migration application process defined in the docs.
Please do not commit work-in-progress migration files to the
master branch. The temporary unreleased/ folder should be
removed once these migrations are released.
2021-01-20 17:55:45 +00:00

9 lines
434 B
SQL

--Storing as json b, create column defined as jsonb
--This contains the award name and award year
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS team_awards jsonb;
--To validate this input, the following confirms it's an valid object but not that the items in the object are validated agains those we will acccept
ALTER TABLE buildings
ADD CONSTRAINT data_is_valid CHECK (is_jsonb_valid ('{"type": "object"}', team_awards));