auction site listings table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

auction site listings table

fugee ohu
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Ariel Juodziukynas
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcA2KaAP2QthGEqOkQWLZ6T6kBnHdmh%2B0_Zp0seGeiGqeg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Andrew Cranston
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 table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20a15754-d659-409d-b32a-0f7a32196143%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu


On Tuesday, September 17, 2019 at 2:58:21 PM UTC-4, Andrew Cranston wrote:
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 table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

I'm trying  to agree with you but why would an auction have many items?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/90625ae6-631e-44f3-af3d-3d6e92172017%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu
In reply to this post by Ariel Juodziukynas


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e1587057-22f2-4c1f-8385-fa16f03e8404%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Hasan Diwan
[response inline]

On Mon, 23 Sep 2019 at 21:02, fugee ohu <[hidden email]> wrote:
Where do the values of the properties go? I don't mean the property name
Properties will have an "id" field, referred to as auction_properties.property_id. Under auction_properties, there is a value field. I'd assume it goes there, right, Ariel? -- 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.

Sent from my mobile device 
Envoye de mon portable

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP%2BbYWD%2BetYsbXCUUcUeQzNZJyqHW9Xu-NT%2BNbdsSvHheKJy5g%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu


On Tuesday, September 24, 2019 at 12:15:02 AM UTC-4, [hidden email] wrote:
[response inline]

On Mon, 23 Sep 2019 at 21:02, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9WpnHKcgBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
Where do the values of the properties go? I don't mean the property name
Properties will have an "id" field, referred to as auction_properties.property_id. Under auction_properties, there is a value field. I'd assume it goes there, right, Ariel? -- H

--
OpenPGP: <a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
<a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">
Sent from my mobile device 
Envoye de mon portable

I see, so they go in the join table

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/964f08b2-222a-48f1-9d4b-45b557f5a374%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu
In reply to this post by Hasan Diwan


On Tuesday, September 24, 2019 at 12:15:02 AM UTC-4, [hidden email] wrote:
[response inline]

On Mon, 23 Sep 2019 at 21:02, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9WpnHKcgBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
Where do the values of the properties go? I don't mean the property name
Properties will have an "id" field, referred to as auction_properties.property_id. Under auction_properties, there is a value field. I'd assume it goes there, right, Ariel? -- H

--
OpenPGP: <a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
<a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">
Sent from my mobile device 
Envoye de mon portable
 Yes, sorry I see, that's the value column in auction_properties

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/81fdcfb3-06fd-4e30-9abe-b4b337bad3a0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu
In reply to this post by Ariel Juodziukynas


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d3c723f7-a946-49da-9e77-ad0912bbdc07%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Hasan Diwan
[response inline]

On Mon, 23 Sep 2019 at 21:32, fugee ohu <[hidden email]> 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.

Sent from my mobile device
Envoye de mon portable

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP%2BbYWAXdmNaFdxF7VeWjbiKq4usnpNEwdHEL504QQG6mPTAPA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu


On Tuesday, September 24, 2019 at 12:37:37 AM UTC-4, [hidden email] wrote:
[response inline]

On Mon, 23 Sep 2019 at 21:32, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ODCjp-IhBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> 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 

--
OpenPGP: <a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a <a href="http://bit.ly/hd1AppointmentRequest" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
<a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">
Sent from my mobile device
Envoye de mon portable

 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Ariel Juodziukynas
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 (<[hidden email]>) escribió:


On Tuesday, September 24, 2019 at 12:37:37 AM UTC-4, [hidden email] wrote:
[response inline]

On Mon, 23 Sep 2019 at 21:32, fugee ohu <[hidden email]> 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.

Sent from my mobile device
Envoye de mon portable

 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDahpvTP45hFT6Gi58iaWL2TTXJGxYsqJeWvojQy%2B31%2BQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu


On Tuesday, September 24, 2019 at 7:18:11 PM UTC-4, Ariel Juodziukynas wrote:
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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LDhXmwhfBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:


On Tuesday, September 24, 2019 at 12:37:37 AM UTC-4, [hidden email] wrote:
[response inline]

On Mon, 23 Sep 2019 at 21:32, fugee ohu <[hidden email]> 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 

--
OpenPGP: <a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using <a href="http://bit.ly/hd1AppointmentRequest" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a <a href="http://bit.ly/hd1AppointmentRequest" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbit.ly%2Fhd1AppointmentRequest\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFt-RujjBqmDCEgp-tLnm421i0Keg&#39;;return true;">bit.ly/hd1AppointmentRequest.
<a href="https://sks-keyservers.net/pks/lookup?op=get&amp;search=0xFEBAD7FFD041BBA1" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsks-keyservers.net%2Fpks%2Flookup%3Fop%3Dget%26search%3D0xFEBAD7FFD041BBA1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDuCTKSPl7dcRwq_hJqIzf3yiIog&#39;;return true;">
Sent from my mobile devicet t
Envoye de mon portable

 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="LDhXmwhfBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/63f7e9f5-eb9a-4618-8ed9-d1f78f3a05b8%40googlegroups.com.

When you sell something on ebay there's no multiple choice of item type to sell, they figure out the type of item and the category from the title you provide but then ask you to confirm or change the category At this primitive stage I was thinking of adding an intermediate page to the new action to allow the user to select the type or category and then when they submit that page the relevant form will be on the next page There's such a thing as fallback also so I think I should build a rest framework first, I don't know

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/38466182-5166-4205-9e65-22af3c4a3d6b%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu
In reply to this post by Ariel Juodziukynas


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

Could I give the join table different value fields for different data types llike text_value, date_value, string_value, ...

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02ff8e61-7024-4b21-a8b0-680507d8cb69%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu
In reply to this post by Ariel Juodziukynas


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="yRZASWVyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

What data type do you suggest for value column

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

M.FURQAN BiN.AMEEN
In reply to this post by fugee ohu
I have a complete project as like in ruby on rail with same tables name you can contact with me further on my email 


Best Regards:
MUHAMMAD FURQAN

On Fri, Sep 27, 2019, 1:16 AM fugee ohu <[hidden email]> wrote:


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

Could I give the join table different value fields for different data types llike text_value, date_value, string_value, ...

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02ff8e61-7024-4b21-a8b0-680507d8cb69%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAMWiOBt-A5qQ7hX4yDyQemWTNx%3DcW05WzHJF5bTbBYA%2BYzntZg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Hasan Diwan
In reply to this post by fugee ohu
[response inline]

On Thu, 26 Sep 2019 at 13:17, fugee ohu <[hidden email]> wrote:
What data type do you suggest for value column?

There were types suggested by the original responder. However, worrying about column types is an instance of premature optimization. 

Get the basic site working, and then optimize, once you have determined your performance needs. -- 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.

Sent from my mobile device
Envoye de mon portable

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP%2BbYWAZG0R%3D1s9gLEpKwoFBuAggSTmA7fPQL3RQD_Q1csC8Dw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Ariel Juodziukynas
In reply to this post by fugee ohu
The easiest but too big is a text columns so you can use activerecord' serialization of attributes to save anything you want on a text field and activerecord will handle casting.

You could use a string column if you know your values won't be too big (VARCHAR(255)) and you know what types you want to accept and handle serialization yourself like:

    def value=(something)
      val = if value.is_a?(Integer)
              "integer:#{something}"
            elsif value.is_a?(String)
              "string:#{something}"
            elsif value.is_a?(Date)
              "date:#{something}
            # etc...
      write_attribute(:value, val)
    end

    def value
      type, val = read_attribute(:value).split(':')
      case type
      when "integer" then val.to_i
      when "string" then val
      when "date" then Date.parse(val)
      etc...
    end
           

El jue., 26 sept. 2019 a las 17:17, fugee ohu (<[hidden email]>) escribió:


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcCM%3DSv-%2BExu7_dh2b7nOZhSv67e8YgHKHPqFuch6r%3D-ug%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

fugee ohu


On Thursday, September 26, 2019 at 4:32:10 PM UTC-4, Ariel Juodziukynas wrote:
The easiest but too big is a text columns so you can use activerecord' serialization of attributes to save anything you want on a text field and activerecord will handle casting.

You could use a string column if you know your values won't be too big (VARCHAR(255)) and you know what types you want to accept and handle serialization yourself like:

    def value=(something)
      val = if value.is_a?(Integer)
              "integer:#{something}"
            elsif value.is_a?(String)
              "string:#{something}"
            elsif value.is_a?(Date)
              "date:#{something}
            # etc...
      write_attribute(:value, val)
    end

    def value
      type, val = read_attribute(:value).split(':')
      case type
      when "integer" then val.to_i
      when "string" then val
      when "date" then Date.parse(val)
      etc...
    end
           

El jue., 26 sept. 2019 a las 17:17, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="SmVk6ZP7BAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/512f8b73-e3a4-4e74-95e7-4281e7b54821%40googlegroups.com.

What data type do you suggest for value column

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="SmVk6ZP7BAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.

 If I'm using a string column then whatever value is put in it is a string, so I don't understand all these "'if value.is_a?" conditions

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93726aa7-2667-4f3b-b27c-6d19d5e5f368%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: auction site listings table

Ariel Juodziukynas
You were asking a way to store different values, I thought you wanted to preserve the type (so you can distinguish 1 from "1" when you read the record).

If you think strings are enough for your requirements just use a string column, if you want to use one column to store values but preserve the original type you have to serialize the value somehow (that's the is_a?... when serializing and the case when casting).

Another option is to use two columns: one for the stringified value and one for the original type so you can parse that again.

El jue., 26 sept. 2019 a las 17:57, fugee ohu (<[hidden email]>) escribió:


On Thursday, September 26, 2019 at 4:32:10 PM UTC-4, Ariel Juodziukynas wrote:
The easiest but too big is a text columns so you can use activerecord' serialization of attributes to save anything you want on a text field and activerecord will handle casting.

You could use a string column if you know your values won't be too big (VARCHAR(255)) and you know what types you want to accept and handle serialization yourself like:

    def value=(something)
      val = if value.is_a?(Integer)
              "integer:#{something}"
            elsif value.is_a?(String)
              "string:#{something}"
            elsif value.is_a?(Date)
              "date:#{something}
            # etc...
      write_attribute(:value, val)
    end

    def value
      type, val = read_attribute(:value).split(':')
      case type
      when "integer" then val.to_i
      when "string" then val
      when "date" then Date.parse(val)
      etc...
    end
           

El jue., 26 sept. 2019 a las 17:17, fugee ohu (<[hidden email]>) escribió:


On Monday, September 16, 2019 at 4:31:29 PM UTC-4, Ariel Juodziukynas wrote:
Personally, I would do this:

auctions table
(with the basic shared information of all auctions and an "auction type"))

properties table
property_name (like network, carrier, publisher, etc)
auction_type (like cellphone, book, etc)

auctions_properties
auction_id
property_id
value

That 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 (<[hidden email]>) 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 [hidden email].
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e74aaf6b-b9e1-4847-a6d3-3120829fa3bc%40googlegroups.com.

 If I'm using a string column then whatever value is put in it is a string, so I don't understand all these "'if value.is_a?" conditions

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93726aa7-2667-4f3b-b27c-6d19d5e5f368%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDCwk%3DBahS3WQ3a6%2Bkcszzkq_z%2BTkbVxZsMYwf2m6U6Sg%40mail.gmail.com.
12