Database connections, I cannot decide which way I should go!

24 views
Skip to first unread message

Jason O

unread,
Mar 16, 2015, 1:00:15 PM3/16/15
to rubyonra...@googlegroups.com
Hello all! And thanks for your help and input.

I am in the process of building my first project for the company I work for and I am stumped as how to tackle my database information problem. 

What I am dealing with is a database with a list of users and a separate table with a list of articles that users have written. The PEOPLE table includes the normal name conventions as so forth, but also a value called Author_ID which is derived from a government entity. 

The ARTICLES table has a value which lists the authors of the articles, normally 2-7 authors per article. Here, I am not sure if this short be an array or just a string. I currently have it as a string. Also of note, some articles may have multiple authors within my PEOPLE table, most will also have authors that are not in my table as they are not a part of my faculty. 

As I have it set up currently I was attempting to do a has_many through connection, but was unsure of how to call the articles for that particular Person. And as I work through the problem in my head I am not sure I even need to make a join of the tables.

My desired end result: Each faulty member's personal page needs to pole the ARTICLES table and list any articles that have the corresponding Author_ID. I am happy to supply any code that I currently have if it is requested. 

Thank you again for your time and help!

Jason

Hassan Schroeder

unread,
Mar 16, 2015, 3:05:40 PM3/16/15
to rubyonrails-talk
On Mon, Mar 16, 2015 at 10:00 AM, Jason O <lostr...@gmail.com> wrote:

> I am in the process of building my first project for the company I work for
> and I am stumped as how to tackle my database information problem.

Is this a legacy DB you're stuck with, or are you trying to design
one for your app?

> What I am dealing with is a database with a list of users and a separate
> table with a list of articles that users have written. The PEOPLE table
> includes the normal name conventions as so forth, but also a value called
> Author_ID which is derived from a government entity.
>
> The ARTICLES table has a value which lists the authors of the articles,
> normally 2-7 authors per article. Here, I am not sure if this short be an
> array or just a string. I currently have it as a string.

Is this a collection of AUTHOR_IDs, or names?

It would probably help to gist the relevant parts of your schema.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Daniel Tordable Dasilva

unread,
Mar 16, 2015, 3:44:27 PM3/16/15
to rubyonra...@googlegroups.com
Anyway a good database schema is needed for a good application. Choose
carefully your database schema and in fact if you get to a good solution
for storaging of data you'll probably win.

Get back to the design!

El 16/03/2015 a las 20:05, Hassan Schroeder escribió:
> On Mon, Mar 16, 2015 at 10:00 AM, Jason O <lostr...@gmail.com> wrote:
>
>> I am in the process of building my first project for the company I work for
>> and I am stumped as how to tackle my database information problem.
> Is this a legacy DB you're stuck with, or are you trying to design
> one for your app?
>
>> What I am dealing with is a database with a list of users and a separate
>> table with a list of articles that users have written. The PEOPLE table
>> includes the normal name conventions as so forth, but also a value called
>> Author_ID which is derived from a government entity.
>>
>> The ARTICLES table has a value which lists the authors of the articles,
>> normally 2-7 authors per article. Here, I am not sure if this short be an
>> array or just a string. I currently have it as a string.
> Is this a collection of AUTHOR_IDs, or names?
>
> It would probably help to gist the relevant parts of your schema.
>

--
--
Daniel Tordable Dasilva <email: dan...@danieltordable.net>
--

Reply all
Reply to author
Forward
0 new messages