Just null the ID field by default then and it should work
2013-03-18 07716, 2013
ocharles
reosarevok: you generally store lists in the opposite direction
2013-03-18 07731, 2013
ocharles
list elements point to the thing that holds the list, not the thing that holds the list pointing to elements
2013-03-18 07746, 2013
ocharles
but if we do flip that round, we can use NULL to model unknown
2013-03-18 07721, 2013
voiceinsideyou joined the channel
2013-03-18 07708, 2013
reosarevok certainly sees [none] as more useful than multiple barcodes. If only because the amount of releases with no barcode is hugely higher than the amount of releases with more than one...
2013-03-18 07724, 2013
reosarevok
So yeah, please make sure you don't break [none] to add this :)
2013-03-18 07757, 2013
reosarevok
(I'm yet to see one release that needs it, although I know some exist - I'm not sure it is really worth the extra complexity but if people really want it)
2013-03-18 07705, 2013
Leftmost
I have one, though it's buried right now.
2013-03-18 07719, 2013
reosarevok
Well, yes, I'm certainly not doubting they exist, and I agree it would be better to be able to store it. It's just that adding several tables for it when the most common situation by far will be that they'll map 1:1 to releases as they do now seems weird
2013-03-18 07745, 2013
reosarevok
(adding extra joins to every single release for the benefit of a few)
2013-03-18 07756, 2013
warp
some is a list of 0 or more actual barcodes. unknown is not none and count(some) = 0.
2013-03-18 07712, 2013
warp
(woops, responding to random old backscroll lines)
2013-03-18 07716, 2013
reosarevok
But I guess it's at least more consistent than "store barcode if there's one, point to list if not"
2013-03-18 07719, 2013
nikki
reosarevok: yeah, I'm not keen on even more joins :(
2013-03-18 07744, 2013
ocharles
make views then
2013-03-18 07756, 2013
nikki
I haven't got a clue how to do that
2013-03-18 07704, 2013
ocharles
create view name as select ...
2013-03-18 07705, 2013
ocharles
that's it
2013-03-18 07708, 2013
zag joined the channel
2013-03-18 07711, 2013
nikki
I don't know how to do the select
2013-03-18 07719, 2013
ocharles
you know how to do a select with a join :)
2013-03-18 07727, 2013
nikki
yes, but I don't know how to select only one barcode
2013-03-18 07747, 2013
nikki
I don't want two rows for a single release just because some stupid release has two
2013-03-18 07749, 2013
ocharles
why do you want to select only one barcode?
2013-03-18 07751, 2013
ocharles
the array_agg
2013-03-18 07752, 2013
ocharles
then*
2013-03-18 07736, 2013
JonnyJD
On the musicbrainz-server VM the "musicbrainz_test" db doesn't exist. Is there a quick script somewhere to create it? With the musicbrainz user I can't create a DB and role "root" doesn't exist either.
2013-03-18 07744, 2013
ocharles
JonnyJD: script/create_test_db.sh
2013-03-18 07747, 2013
ocharles
it's in HACKING
2013-03-18 07755, 2013
ocharles
hmm, actually, it isn't
2013-03-18 07756, 2013
ocharles
tut
2013-03-18 07713, 2013
JonnyJD
No, it isn't
2013-03-18 07705, 2013
JonnyJD
It probably should be in "HACKING" though.
2013-03-18 07710, 2013
ocharles
i'm adding it now
2013-03-18 07742, 2013
reosarevok
ocharles: why not just one table, (release.id, barcode), for which barcode contains either null, '' or a barcode? + a trigger like "if barcode is null, instead of new insert, update that"?
2013-03-18 07758, 2013
ocharles
reosarevok: that doesn't set you store multiple barcodes
2013-03-18 07702, 2013
ocharles
oh wait, a separate table, sorry
2013-03-18 07708, 2013
reosarevok
ocharles: it does if release.id isn't a key
2013-03-18 07722, 2013
ocharles
yes, you can do that, but now you have to write triggers to enforce integrity
2013-03-18 07725, 2013
reosarevok
It's still lots of stuff for little gain, but if we want the little gain
2013-03-18 07740, 2013
ocharles
when you could just model it to express the constraints you want
2013-03-18 07704, 2013
warp
make barcode an array type in the database :)
2013-03-18 07726, 2013
reosarevok
I guess if I say "since barcodes hopefully don't have commas in them, enter them as comma-separated values" in the barcode column I'll get slapped, right? :p
2013-03-18 07741, 2013
ocharles
warp: that is an option
2013-03-18 07749, 2013
warp
reosarevok: postgresql has proper array types for lists of things.
2013-03-18 07757, 2013
ocharles
with a GIN you can index that too
2013-03-18 07723, 2013
warp
NULL is unknown, empty list is no barcode aka none, items in the list are barcodes.
2013-03-18 07729, 2013
reosarevok
warp: oh, ok :) (that also wasn't in my introductory course :) )
2013-03-18 07747, 2013
reosarevok
If that's doable, it sounds sensible
2013-03-18 07758, 2013
Leftmost
GIN?
2013-03-18 07703, 2013
ocharles
that does however, make it difficult to enforce that barcodes form a set, not a list
I guess if I say "add a second column for additional barcodes and leave the first one on the table as-is" I'll get shouted at, right? :p
2013-03-18 07728, 2013
reosarevok
(with that second column pointing to a second table or whatever)
2013-03-18 07740, 2013
reosarevok
Mineo: no
2013-03-18 07754, 2013
reosarevok
(but I guess you knew :p)
2013-03-18 07737, 2013
reosarevok
I guess we could do the multiple tables thing and *then* a view with arrays though?
2013-03-18 07740, 2013
Mineo
I was unsure if the troubles last night required the links to be changed :)
2013-03-18 07710, 2013
reosarevok
Mineo: ok, my actual answer is "sounds extremely unlikely" then :p
2013-03-18 07716, 2013
ocharles
reosarevok: yes to both questions :)
2013-03-18 07732, 2013
ocharles
reosarevok: the view with an array is what I was suggesting above
2013-03-18 07752, 2013
Leftmost
Hmm. I'm guessing Ian was right and I'm not going to finish this review by today.
2013-03-18 07756, 2013
reosarevok
The main problem I can see with views is that they make it more annoying to graphically document the useful ways to use the schema (as in, I have no idea how it could be done)
2013-03-18 07719, 2013
reosarevok
Sure, you could document the actual tables but if nobody ever is going to want to use them that way...
2013-03-18 07713, 2013
reosarevok
(do we have any documentation about our current views, btw?)
2013-03-18 07718, 2013
ocharles
no
2013-03-18 07736, 2013
reosarevok
:(
2013-03-18 07757, 2013
ocharles
Leftmost: I think release(id, barcode_set nullable, ...), barcode_set(id), and barcode (barcode_set, barcode) might be the way to go.
2013-03-18 07716, 2013
ocharles
primary keys on barcode_set.id and barcode.barcode
2013-03-18 07727, 2013
Leftmost
Okay.
2013-03-18 07708, 2013
Leftmost
I'm making a note of that and trying to get a bit of sleep. I'll push the changes in a few hours.
2013-03-18 07716, 2013
Leftmost
Thanks for talking it out with me.
2013-03-18 07729, 2013
ocharles
No worries
2013-03-18 07731, 2013
ocharles
it's a tricky one
2013-03-18 07714, 2013
reosarevok
ocharles, can you look at wtf is going on with the links Mineo mentioned?
2013-03-18 07739, 2013
ocharles
is it urgent or can I have lunch first?
2013-03-18 07752, 2013
reosarevok
have lunch
2013-03-18 07759, 2013
reosarevok
:)
2013-03-18 07701, 2013
ocharles
ok, will look after :)
2013-03-18 07715, 2013
ocharles
Mineo, reosarevok: oh, bah - that was me "fixing" the wiki docs while internal DNS was broken
2013-03-18 07718, 2013
ocharles
let me just fix that
2013-03-18 07720, 2013
ocharles
Ok, should be better now
2013-03-18 07730, 2013
reosarevok
Seems to still point to the wiki?
2013-03-18 07741, 2013
reosarevok checks whether it is cache
2013-03-18 07751, 2013
reosarevok
Doesn't seem so
2013-03-18 07756, 2013
ocharles
there might be a cache server side
2013-03-18 07716, 2013
ocharles
i believe it'll fix itself in an hour
2013-03-18 07718, 2013
reosarevok
Ok
2013-03-18 07721, 2013
reosarevok
We'll see
2013-03-18 07723, 2013
reosarevok
:)
2013-03-18 07730, 2013
ocharles
yea, I think that's easiest
2013-03-18 07742, 2013
ocharles
ocharles has changed the topic to: š SUNRISE week | http://musicbrainz.org/#devel | note about meeting time in the US: http://bit.ly/Ym40ql | Agenda: reviews, MBS-5933 (ocharles), mbs-2079 (nikki), code reviewing non-MBS projects (ocharles/warp), MBS-2411 (ocharles)
2013-03-18 07758, 2013
ocharles
I hope you don't mind me shoving a schema change ticket in front of 2079, nikki :)
2013-03-18 07715, 2013
JonnyJD
should fixes for (old) update scripts in admin/sql/updates go to master or beta? (I have one for 20130125)
2013-03-18 07700, 2013
warp
JonnyJD: I consider update scripts to be things which run once on release. So in general I would say you need to add a new script.
2013-03-18 07736, 2013
warp
JonnyJD: either way, pull requests should go to beta.
2013-03-18 07707, 2013
JonnyJD
Well, I am running that update script now and it errors out. Not sure if later update scripts depend on this
2013-03-18 07752, 2013
warp
why not just get a new dump? january is quite some time ago.
2013-03-18 07753, 2013
nikki
ocharles: actually I just want to know what we should do with that ticket. most of the comments (and probably most of the votes too) are for a feature we added, but technically we haven't fixed the thing that's asked for... but I'm sick to death of seeing that ticket, thinking "...didn't we already add that?" and then realising I've mistook it for something else yet again
2013-03-18 07728, 2013
nikki
so it's not really that important, just annoying :P
2013-03-18 07739, 2013
JonnyJD
Well, I don't actually want new data and I really don't want to move the whole DB again because I would run out of space in the VM with a complete update
2013-03-18 07747, 2013
ocharles
nikki: ok (:
2013-03-18 07703, 2013
hawke_1 joined the channel
2013-03-18 07705, 2013
warp
nikki: hm, marked is "In Progress" without being assigned seems odd.
2013-03-18 07715, 2013
hawke joined the channel
2013-03-18 07710, 2013
nikki
warp: yeah. the whole ticket is a mess. it got set to in progress when ollie was doing the relationship editor thing he started (which, note, is not what the ticket asked for either :P)
2013-03-18 07737, 2013
JonnyJD
warp: Anyways, I fixed the script so it works and would like to submit that upstream if anybody is interested. I don't think it is that important that a new script needs to be created.
2013-03-18 07748, 2013
nikki
I'm thinking it might be better to just make a new ticket for original requested behaviour and close that one and tell people to go vote for the new ticket if they still want it
2013-03-18 07701, 2013
warp
JonnyJD: ok, well just submit it as a pull request to beta like any other change.
2013-03-18 07720, 2013
nikki
so that we have some idea of how many people actually want that and how many were just like "gaaaah I can't link works for a release" (since solved by the relationship editor)
2013-03-18 07745, 2013
ocharles
nikki: i'm fine with that
2013-03-18 07756, 2013
warp
nikki: that sounds like a perfectly reasonable thing to do.
2013-03-18 07714, 2013
nikki
then maybe I should just do that now and take it out of the agenda :P
2013-03-18 07753, 2013
zag has left the channel
2013-03-18 07739, 2013
djce joined the channel
2013-03-18 07732, 2013
Jormangeud joined the channel
2013-03-18 07745, 2013
murdos joined the channel
2013-03-18 07751, 2013
voiceinsideyou joined the channel
2013-03-18 07733, 2013
voiceinsideyou1 joined the channel
2013-03-18 07705, 2013
JonnyJD
is there a known validator.nu "mirror"? http://validator.nu is offline and testing takes ages since it always waits for a timeout. (I did set an empty validator in DBDefs.pm for now)
2013-03-18 07724, 2013
voiceinsideyou joined the channel
2013-03-18 07711, 2013
warp
JonnyJD: you can run your own
2013-03-18 07724, 2013
ijabz joined the channel
2013-03-18 07731, 2013
warp
(assuming the source repositories are still online)