nonironman / flotski

awesome booking system
2 stars 0 forks source link

Create DB Scheme #1

Open venmer opened 6 years ago

Bright-Head commented 6 years ago

Database schema has been added to repo. Need to be reviewed and approved.

Bright-Head commented 5 years ago

DB schema should be verified. After discussion about user id info in Room and Guest tables I'd like to suggest add user_id field to Guest, because I think it makes sense to keep info about User who creates guest or change their info later. About rooms: state is not relevant for room as for static instance (in general), state is more relevant for booking as a room state in particular time period, and I think that Booking can be extended by state field from Room, which means room state in specified time period. Also in this case user id will be saved as a marker for indicating who created this state. @venmer , what do you think?

venmer commented 5 years ago

TODO: was decided to add user_id FK field to Guest and Booking tables. state field will be removed from Room table, actual room state depends on current booking. Booking table will be extended with an optional field - description

Bright-Head commented 5 years ago

TODO: Add state to User instance as active/inactive indicator.

venmer commented 5 years ago

implemented under #10

Bright-Head commented 5 years ago

@venmer, I think that room can't be permanently deleted as well as user, and room should have state for active/inactive state. What do you think? Also in case state=inactive, room is unavailable for booking creation.

venmer commented 5 years ago

@Bright-Head, agreed. Room table will be extended with state=(active,inactive) as well.

venmer commented 5 years ago

included in #10

venmer commented 5 years ago

@Bright-Head, please correct relations between GuestToBooking and Guest entities