Last active
March 29, 2022 15:45
-
-
Save mrdotb/44e688ac3b66bb0df09eb71f77aa597b to your computer and use it in GitHub Desktop.
opening_hours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table opening_hours | |
( | |
-- il est possible d'utiliser les horaires d'une boutique en particulier pour l'eshop | |
point_of_sale_id uuid REFERENCES point_of_sale (uuid), -- donc nullable | |
-- il est aussi possible pour l'eshop d'avoir ses propres horaires | |
terminal_eshop_id uuid REFERENCES terminal_eshops (uuid), -- donc nullable | |
day_of_the_week integer NOT NULL, | |
open time without time zone not NULL, -- est-ce qu'on a besoin de stocker la time zone ? | |
close time without time zone not NULL | |
); | |
-- TODO | |
-- create sql constraint | |
-- day of the week should be between 1 and 7 | |
-- if day of the week already exist the open_time should be grater than the existing close per point_of_sale_id, terminal_eshop_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment