@Jeremy: Yes, I was cringing at the length of my post too, but I've
been thinking about this a while and I felt compelled to explain
fully. Thanks for time. It sounds like you got the point perfectly,
and your suggestions are right in line with my thinking. I'm happy :)
I imagine I'll want to use containable a lot because almost every
other table belongs to it and it will save a lot of time to unbind the
ones not needed.

@zaky: I looked up mysql views and it is interesting, but I'm not sure
why I would use it. Yes, the public schedules are read only, but the
user editing the not-yet-published schedule is viewing in just the
same way (plus the ability to edit). Why would I create separate logic
for the public MVC when it's just a subset of the editing
functionality? Can give an example of how mysql views could help?

Thanks,
Jason



On May 10, 11:06 pm, Zaky Katalan-Ezra <[email protected]> wrote:
> Does the public database is read only from the end user perspective?
> If it is you can use MySql views as a model table.
> Cake treat views as table.
> I think its more easy to maintain read only data this way.
>
> About the data structure it seems you are in the right way.
> If you want to take an example from an invoicing process in a big
> application i use which look pretty much the same to me.
> Use two tables:
> schedules: batch_id, start_publishing, end_publishing (null for current, new
> schedule set this value to the strat_publishing of the new schedule minus 1
> day), number of employees?, or any accumulated data you need in the schedule
> level.
>
> schedules rows:
> id, batch_id,.....
>
> You can use [year]_[number of week (1-52)] as a batch number for human
> readability.
>
> The session parameter for current batch looks good
>
> On Tue, May 11, 2010 at 2:14 AM, paws_galuten <[email protected]>wrote:
>
>
>
>
>
> > Hi,
>
> > My question is below, but first some info about the situation I'm in:
>
> > I am taking an app that I wrote years ago for scheduling people in
> > different areas of work at our Center, and re-writing it in cakePHP.
> > In the mean time, I'm doing all sorts of things better than ever
> > before ;)
>
> > Among many other details, there are areas, people, shifts, etc. and
> > the whole configuration (what people are scheduled for what shifts and
> > at what time) is called a schedule. The person writing the schedule
> > has a lot of work to do as people come in and out, and there was the
> > necessity for a staging area. The way I did this in the old app, was
> > to have two totally separate databases called scheduler_staging, and
> > scheduler_public. This way, when the scheduler logged in, they would
> > be editing the scheduler_staging database, and then when the schedule
> > was ready, they could publish it, which would copy scheduler_staging
> > to scheduler_public. I wanted to keep a record of all old publishes,
> > so I added a table in scheduler_public called schedules and added a
> > foreign key schedule_id to all other tables. So, when a schedule got
> > published, it all of the data would be copied from scheduler_staging
> > to scheduler_public, but with a new schedule_id.
>
> > Ok, so that worked great, but now I'm learning that there are
> > disadvantages to having multiple databases for one app. In my new
> > cakePHP version of this app, I want to try to get all of this
> > functionality under one "roof."
>
> > One idea I had was to have scheduler_public be the only database (just
> > call it scheduler) and in that schedules table have a boolean field
> > called published. Or even better, a field called publish_date (which
> > would be null if the schedule is not published yet). So the public
> > could easily view the latest published schedule, and the scheduler who
> > logs in could edit the schedule that has not been published yet.
>
> > Two questions:
> >    1. Am I going in the right direction here, or does this seem way
> > off?
> >    2. Assuming this works, could I just access everything through the
> > schedule model? In other words, the current "schedule" is a group of
> > data from all of the tables with the same schedule_id, so when I'm
> > viewing schedule #2133 I would get everything I need as related model
> > data from the schedule model... I am thinking the schedule id would be
> > in the session which would default to the most recently published...
> > so, the schedules controller would get the current schedule id from
> > the session and hand it to the schedule model. If I want to view
> > person #3, it would be ('controller' => 'schedules', 'action' =>
> > 'view_person', 3) and then the schedule model would fetch the person
> > data (and the shift data, and the area data... it's all needed to
> > display a person and their info).
>
> > I guess I'm back to question #1... does this make sense??
>
> > Thanks so much for your thoughts,
> > Jason
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<cake-php%[email protected] 
> > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to