Creating migrations files to create movies table and add movies check constraints. Updating API version number. Updating README.md adding 'SQL Migrations' section. Updating deployment file to make migrations before building API. Adding some .idea files into .gitignore.
Some checks failed
Deploy Greenlight API / deploy (push) Failing after 40s

This commit is contained in:
Maxime Delporte
2025-10-30 15:16:20 +01:00
parent f72ad2aa2f
commit 641f430fd4
8 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
ALTER TABLE movies ADD CONSTRAINT movies_runtime_check CHECK (runtime >= 0);
ALTER TABLE movies ADD CONSTRAINT movies_year_check CHECK (year BETWEEN 1888 AND date_part('year', now()));
ALTER TABLE movies ADD CONSTRAINT genres_length_check CHECK (array_length(genres, 1) BETWEEN 1 AND 5);