-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database Structure #5
Comments
rather than base access on the parish, I would base it on the couple getting married, because here in Rome for example hardly anyone gets married in their own parish, everyone either goes to one of the Basilicas or baroque churches or they even go outside of Rome to a church in the countryside. |
That makes sense. I think a single database will be more than sufficient for our needs, and we can use some variation of a column identifier for the priest (if a priest account is associated with the couple). |
Perhaps we could rename this issue "database structure"? I think one database would be fine, in which there would be:
|
reading up on rails, it seems almost like you wouldn't directly create databases and tables, but simply Models and rails takes care of creating the database tables behind these models? Still trying to wrap my head around this approach. Perhaps it would be useful to create a wiki on the github repo, so as to document each step of the development process, which would help to make it reproducible I'm reading up on the rails Model / Database approach, and as this is built, it would be nice to create documentation so everyone knows what steps were taken to make it happen I can pretty much understand the ERB approach in rails, it's kind of similar in some ways to Google Apps script, where Apps script has a javascript templating approach, and you wind up mixing regular html + javascript with the "server side" Apps script through template tags quite similar to the ERB template tags The intro tutorial to rails explains how to create a blog, and gives examples of Article and Comment models, I'm trying to figure out how to translate this to Models needed for the marriage booklet project |
For example, would you create a Model for Users? and a Model for Projects? and a model for Liturgical Texts? |
Something like:
This is a very general skeleton of an idea, not yet knowing the inner workings of rails. I'm not yet sure how to handle multiple choices between alternate text options. One step at a time I guess. |
What I'm trying to understand now is, when you generate a Model, which in turn generates a database migration, is this process conceived mainly for tables whose data is not defined from the start, but whose data will be created dynamically in the app? For example, the Users table: every time a new user signs up to the website, a record is added to the users table. The same for the Projects table: every time a new project is created, a record is added to the projects table. However, the LiturgicalTexts table will almost never change: no data is added to it, no data is removed from it. Until there is a reform of the Marriage liturgy, those texts will stay the same. Would this still require defining a Model? Or could you just operate directly on the database and preload the liturgical texts table with the necessary data? (Of course that would mean that, if using for example PostgreSQL, the data would not be a part of the marriage booklet repo unless the table for the Liturgical Texts were backed up and included in the repo under a data backup folder or something) |
no. models are just that, a representation of the underlying data. models are very powerful as they allow you to skip writing sql directly. For example, to associate a project with a liturgical text you could write something like migrations are generated anytime you change the model. the initial migrations will be to create the tables, but additional migrations will be generated as the project evolves and we modify tables and columns. this helps ensure that the database structure is consistent across environments. |
Sorry for my delayed reply. Been a little busy this week...
Yes! I'd propose a schema like this:
Yes, and I like most of the columns you've already listed above. Some notes to consider:
Storing these in a database is one option. I think there are probably others we might want to consider. Data inside a database is somewhat difficult to work with - particularly if it's a long-format like liturgical texts. Given that these are static, another option is to store them as text files somewhere. There are probably even things we could do to store them as Your I'd propose we open separate issues for each of these (users table, projects table, liturgical texts) to continue specific discussion there. The user accounts will be fairly quick, and I have some boilerplate from similar projects that can get us moving with the ability to log in. The other two will probably require a little more discussion before we're ready to jump into code, though we might try experimenting with some code and see where we end up. |
I would store as string arrays, one for bridesmaids and one for groomsmen. Since in a wedding ceremony there can be up to about 5 bridesmaids (typically 3) and up to 5 groomsmen (typically 3), and all we need is their names to print them like on the inside cover of the booklet as part of the wedding party (they don't need user accounts or access to the project), I think string arrays would work just fine. |
I've done most of my weddings here in Italy, it's been a while since I did one in the United States, so perhaps you would be able to tell me whether there is just the Best Man and the Maid of Honor in a marriage liturgy in the United States. Here in Italy there are typically three bridesmaids and three groomsmen, and they all sign the certificate of marriage along with the Bride and Groom at the end of the liturgy |
Looking at this website of a Catholic parish in the United States, I see they mention both the Maid of Honor and the bridesmaids, and both the Best Man and the groomsmen. Perhaps for English we can have a string for Maid of Honor, a string for Best Man, a string array for bridesmaids, and a string array for groomsmen? |
In the US there is a Maid/Matron of Honor and a Best Man. These are the only two that sign the marriage certificate. The whole wedding party could be huge, 10 on each side potentially. In many wedding booklets i see there is both their honorary title and their relationship to the couple. Perhaps a
I think the role and relationship could be user defined although we could provide some suggestions like 'Maid of Honor, Matron of Honor' etc. |
I think we can try to keep everything as simple as possible, and only define the minimum information actually needed for the project, without making the tables too complex. |
Oh I see, you mentioned that some couples actually do like to print the kind of relationship that the Best Man or Maid of Honor have with them. Well if that's the case, then I guess we should foresee this possibility. |
As for emails, I figure email could be useful not just for login but for communications and sending notifications. I would allow a user to login with either email or username, as they prefer, because some people are used to using usernames, some people are more used to using their email for login. I would allow for both.
|
It might be a nice touch to send a "congratulations" to the couple from the marriage booklet website around the date of the wedding. |
In the US it's most common to have a single best man and maid of honor sign the marriage certificate. However, as Mike Truso alluded to, it's also very common to print the entire wedding party - including all bridesmaids and groomsmen in the wedding program/booklet, with their relationship to the bride and groom as in the example below. Here's an open source wedding program from the US. I actually based mine off this for my own wedding, though I never published my changes. (This program seems a little more thorough than what I think you'd most commonly find.) https://github.com/schuster/wedding-program https://github.com/schuster/wedding-program/blob/master/wagner-schuster-wedding-program.pdf |
Might not be a bad idea to collect several samples like this to get ideas for what we're building? I'll start a separate issue where we can track those and talk about them. #17 |
Seems to me that sqlite is currently being used as the backend database? Perhaps if we're wanting to use arrays, PostgreSQL has better support? |
I guess if we want to keep track of I'm trying to read up in the rails documentation about how to handle the If we were to use a separate table for the wedding party, with a many-to-one relationship to the single project, how would you go about defining that in the scaffolding? Something like this? I guess it would be similar for the users that have access to a single project, that would also be a many-to-one relationship, since more than one user will have access to a single project: bundle exec rails generate scaffold Project liturgy:integer brideFirstName:string brideLastName:string groomFirstName:string groomLastName:string celebrantNamePrefix:string celebrantFirstName:string celebrantLastName:string church:string city:string weddingdate:datetime
bundle exec rails generate scaffold User username:string email:string role:integer password_digest:string project:references
bundle exec rails generate scaffold WeddingPartyMember partyMemberFirstName:string partyMemberLastName:string partyMemberRole:integer partyMemberRelationship:string project:references A few more questions:
|
A single Tenant (parish) should be able to manage all of the weddings and users related to it, but not see data related to other tenants. Determine how best to segment this data. Some common schemes. Also determine if there are existing libraries to assist with this in rails.
The text was updated successfully, but these errors were encountered: