I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
Agreed - relational tables are the way to go here. Only one suggestion I'd make is around semantics, I'd rename auctions to auction_items, and then the join table would need to be auction_item_properties.
I may be misunderstanding, but my thinking is an auction to be the top-level bucket which has properties like a start time, end time, location, membership, lots/items, etc - so it would have many items.
If each auction is item-specific however, then ignore this comment :)
On Monday, September 16, 2019 at 1:31:29 PM UTC-7, Ariel Juodziukynas wrote:
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if youto at're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Where do the values of the properties go? I don't mean the property name
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
But then a single item will contain many records, one for each property, wouldn't that create too-large-tables?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.
Another option (if your database accepts it, like postgres or newer MySQL versions) is to use a column with JSON or JSONB type. You could have a json object with all property/value pairs. I'm not sure about performance, indexing, etc on JSON columns though.I'm not sure what are the categories you are talking about now, you mean the "auction type"?
You'll have to have many many millions of auctions in order to make the auction_properties tables too large (if your ID is an int, you have 2,000 MILLION ids to use, if you use bigint I don't even know that number, you'll need really good indexes though haha), and even if you ever get near some critical situation you could split table by auction type or something like that. I doubt it's something you have to worry about right now, you'll have a lot of more important things to improve before reaching that.
El mar., 24 sept. 2019 a las 19:19, fugee ohu (<fuge...@gmail.com>) escribió:
[response inline]On Mon, 23 Sep 2019 at 21:32, fugee ohu <fuge...@gmail.com> wrote:But then a single item will contain many records, one for each property, wouldn't that create too-large-tables?By the time that becomes a problem, you'll have bigger things to worry about it, mate. -- H--
If you wish to request my time, please do so using bit.ly/hd1AppointmentRequest.Si vous voudrais faire connnaisance, allez a bit.ly/hd1AppointmentRequest.
I can't make up my mind First, there's countless types of items Next they may use the category in deciding which form to load We haven't take categories into account yet in this discussion
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
What data type do you suggest for value column?
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02ff8e61-7024-4b21-a8b0-680507d8cb69%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93726aa7-2667-4f3b-b27c-6d19d5e5f368%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02ff8e61-7024-4b21-a8b0-680507d8cb69%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.
undefined method `year' for #<Item:0x007fad724a6f38>
year is one of the properties i created in the item_properties table
has_many :item_properties, through: :item_item_properties
how do i get the fields for item_item_properties on the new item form?
What's that?
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)
El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:
I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Personally, I would do this:auctions table(with the basic shared information of all auctions and an "auction type"))properties tableproperty_name (like network, carrier, publisher, etc)auction_type (like cellphone, book, etc)auctions_propertiesauction_idproperty_idvalueThat way you can have any number of auction types with any number of specific properties with just 3 tables.Note that the "value" column would be some string variation (VARCHAR, CHAR, TEXT, etc) depending on your needs, maybe you want to redesign it a little if you want to store different types. Like if you want to store an integer (and retrieve an integer) you'll have to save the original type and reparse it (you could use serialization but that requires a TEXT column and maybe you can't use that many space)El lun., 16 sept. 2019 a las 17:19, fugee ohu (<fuge...@gmail.com>) escribió:I was looking at some auction projects that use a single listings table for all auctions but I know on auction sites the form will be different for different types of items like if you're selling a cell phone there'll be a form field for network, carrier, whatever and if you're selling a book there'll be form fields for publisher, year of publication, so they would have separate tables I assume for books, cell phones, etc? Then how would they treat them all as one?--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fad5e82f-223a-456f-af18-d1e42529b3f0%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fad5e82f-223a-456f-af18-d1e42529b3f0%40googlegroups.com.