*** che-arne has joined #storyboard | 00:01 | |
*** mfer has joined #storyboard | 00:16 | |
*** mfer has quit IRC | 00:16 | |
*** miqui has quit IRC | 02:05 | |
*** che-arne has quit IRC | 02:17 | |
*** jesusaurus has quit IRC | 05:26 | |
*** saju_m has joined #storyboard | 05:58 | |
*** jcoufal has joined #storyboard | 08:22 | |
*** jcoufal has quit IRC | 08:54 | |
*** hashar has joined #storyboard | 08:57 | |
*** jcoufal has joined #storyboard | 09:24 | |
*** jcoufal has quit IRC | 09:25 | |
*** jcoufal has joined #storyboard | 09:26 | |
*** jcoufal has quit IRC | 10:07 | |
*** jcoufal has joined #storyboard | 11:13 | |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: Added db_api for comments https://review.openstack.org/81232 | 11:53 |
---|---|---|
*** hashar has quit IRC | 12:04 | |
*** hashar has joined #storyboard | 12:14 | |
*** jcoufal has quit IRC | 12:19 | |
*** hashar has quit IRC | 13:12 | |
*** hashar has joined #storyboard | 13:14 | |
krotscheck | NikitaKonovalov: SO I found this the other day: | 13:16 |
krotscheck | https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/session.py | 13:16 |
krotscheck | Specifically the section on soft deletes | 13:17 |
krotscheck | AFK for a bit, have to restart a few things | 13:17 |
*** krotscheck has quit IRC | 13:18 | |
*** mfer has joined #storyboard | 13:22 | |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: [WIP] Comments controller https://review.openstack.org/81505 | 13:41 |
*** david-lyle has quit IRC | 13:48 | |
*** che-arne has joined #storyboard | 14:33 | |
*** miqui has joined #storyboard | 14:34 | |
ruhe | NikitaKonovalov: re https://review.openstack.org/#/c/81232 - why didn't you add tests to tests/db/test_db_apy.py? migration path is also not tested. | 14:44 |
* ttx tries to celan up legacy tables again | 14:52 | |
ttx | clean | 14:52 |
NikitaKonovalov | ruhe: I found that file, tests are comming soon .. | 14:55 |
ruhe | NikitaKonovalov: great, thanks! | 14:56 |
ruhe | i just can't let myself +1 code without tests :) | 14:56 |
*** david-lyle has joined #storyboard | 14:58 | |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: Added db_api for comments https://review.openstack.org/81232 | 15:02 |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: [WIP] Comments controller https://review.openstack.org/81505 | 15:03 |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: Added db_api for comments https://review.openstack.org/81232 | 15:11 |
ttx | this alembic thing is confusing as hell | 15:24 |
ttx | anyone knows the syntax for removing a foreign key column to a table I want to remove ? | 15:27 |
ttx | mordred: ^? | 15:27 |
ttx | looks like I need to drop_constraint and then drop_column | 15:27 |
ttx | but drop_constraint wants the name of the FK constraint and the original creation did not mention any name | 15:28 |
ttx | see, that's why i didn't want us to implement migrations while we were still heavily reworking the DB | 15:31 |
ruhe | ttx: why might want to wipe out current DB (there is too much garbage there) and use that to merge all existing DB migration scripts | 15:33 |
ruhe | ttx: can you upload your WIP code and leave a comment where you need your changes in Alembic? | 15:34 |
ruhe | *we might want | 15:34 |
ttx | i'll get it to work alright, but it ain't be prett | 15:36 |
ttx | y | 15:36 |
*** jcoufal has joined #storyboard | 15:39 | |
*** jcoufal has quit IRC | 15:39 | |
openstackgerrit | Thierry Carrez proposed a change to openstack-infra/storyboard: Remove Branch and Milestone legacy tables https://review.openstack.org/81562 | 15:41 |
ttx | ruhe: that works locally... But see my comment on the brittle-ness | 15:43 |
*** krotscheck has joined #storyboard | 15:46 | |
ruhe | ttx: ack | 15:46 |
ttx | boohoohoo | 15:50 |
krotscheck | eh? | 15:51 |
* ttx sobs | 15:51 | |
ttx | krotscheck: i'm tired of Alembic preventing me from cleaning up legacy tables | 15:51 |
krotscheck | ttx: Didn't ruhe fix that? | 15:52 |
krotscheck | I'm guessing some other bug showed up. | 15:52 |
ttx | krotscheck: no, it's just my alembic-foo not being up to par | 15:52 |
ruhe | krotscheck: that's another thing. ttx can't run migration because there is no way to delete FK which has no name | 15:53 |
ttx | can't figure how to drop that FK without getting mysql-specific | 15:53 |
krotscheck | Oh, interesting. | 15:53 |
ttx | which is stupid since (1) we only want to supprot mysql IIRC and (2) we don't have a prod Db yet | 15:53 |
krotscheck | Yeah, that makes sense. | 15:53 |
krotscheck | ttx: We do have a prod db. | 15:53 |
krotscheck | At least I thought we did | 15:54 |
krotscheck | Didn't mordred mention that having foreign keys in general is kind of pointless? | 15:54 |
ruhe | ok, if everyone votes to get rid of Postgres support, it shouldn't be difficult | 15:54 |
ttx | krotscheck: well yes, but there are in the initial thing | 15:54 |
ruhe | but | 15:54 |
ttx | krotscheck: so we kinda need to remove them | 15:54 |
krotscheck | Righto | 15:55 |
ruhe | that mean that we make our codebase MySQL specific | 15:55 |
openstackgerrit | Nikita Konovalov proposed a change to openstack-infra/storyboard: Added db_api for comments https://review.openstack.org/81232 | 15:55 |
krotscheck | Hrm | 15:55 |
krotscheck | So when postgres doesn't get an FK, it auto generates a name? | 15:56 |
krotscheck | Sorry | 15:56 |
ttx | again, probably doable -- just a lot of skill and pain needed to clean up early mistakes | 15:56 |
krotscheck | When it doesn't get a named FK, it auto generates one? | 15:56 |
krotscheck | Or is this a sqlalchemy thing | 15:56 |
ttx | krotscheck: yep, it autogenerates one, but it's Db-dependent. And the ndop-constraint wants the name | 15:57 |
ttx | drop_constraint* | 15:57 |
ttx | krotscheck: I hardcoded the mysql autogenerated name, but that obviously fails with pgsql | 15:58 |
ttx | yay. | 15:58 |
krotscheck | ttx: You can probably switch on the engine name - if it contains mysql do one thing, otherwise do another. | 15:59 |
krotscheck | ttx: And then do one single patch that drops all foreign keys. | 15:59 |
ttx | if I had a clue what pgsql does use, I probably would | 16:00 |
krotscheck | I hear there's documentation :) | 16:01 |
ttx | krotscheck: in all cases relying on the autogenerated name is exceptionally brittle | 16:04 |
ttx | because it may just change | 16:04 |
ttx | so I wish there was another way to fix this | 16:04 |
ttx | I was unhappy with hardcoding the mysql case, i'm even more unhappy to hardcode names for all potential DBs :) | 16:05 |
krotscheck | ttx: Well, we could patch our previous migrations in the codebase, then manually go update the foreign key names in our prod DB. | 16:06 |
ttx | krotscheck: ah, interesting. we could even retroactively set them to the names that happen to be in our DB. | 16:07 |
krotscheck | ...but I don't have access. Because someone won't give it to me. | 16:07 |
ttx | that would avoid the "manually go update" step | 16:07 |
krotscheck | ttx: That would result in a 'clean' database so to say. | 16:07 |
krotscheck | ttx: Fair point. | 16:07 |
ttx | you still need to get to those names | 16:07 |
ttx | krotscheck: if we do that, i would drop all the ForeignKeys | 16:08 |
ttx | if that's desirable to follow the mordred style of table creation | 16:08 |
krotscheck | ttx: Yes, but we can get those names simply by setting up a local db. | 16:09 |
krotscheck | ttx: Well, assuming the names aren't random | 16:09 |
ttx | krotscheck: assuming. | 16:09 |
ttx | OK, will have a try at that | 16:10 |
ttx | Unless mordred screams when he reads that backlog | 16:10 |
krotscheck | mordred has broken our build more often than you have. I don't think he has any bitching rights right now. | 16:11 |
cody-somerville | I don't think we should get rid of FK. I think mordred was speaking sort of tongue-in-cheek | 16:19 |
cody-somerville | also, the inability to delete FK sounds like bug in alembic or somewhere. | 16:22 |
cody-somerville | (or missing feature) | 16:22 |
cody-somerville | as alembic should be able to look the constraint name up via ANSI standard information_schema table | 16:24 |
*** hashar has quit IRC | 16:39 | |
*** krotscheck has quit IRC | 16:55 | |
ttx | cody-somerville: yes, looks like missing feature and corner case of not specifying the FK constraint name in the first place | 16:59 |
* ttx will wait for a settlement on the desirability of FKs before writing a pathc to get rid of them | 16:59 | |
*** krotscheck has joined #storyboard | 17:11 | |
*** krotscheck_ has joined #storyboard | 17:13 | |
*** krotscheck has quit IRC | 17:13 | |
*** krotscheck_ is now known as krotscheck | 17:13 | |
krotscheck | Hrm. | 18:12 |
krotscheck | I'm looking through Oslo right now, and there's some odd feature-specific stuff in there. | 18:12 |
krotscheck | Like - why does utils.model_query have an explicit property called project_id? | 18:13 |
krotscheck | Do all users of the sql alchemy extensions have a concept of a project? | 18:13 |
*** saju_m has quit IRC | 19:21 | |
*** saju_m has joined #storyboard | 19:22 | |
*** hashar has joined #storyboard | 19:47 | |
*** saju_m has quit IRC | 20:08 | |
*** saju_m has joined #storyboard | 20:08 | |
*** krotscheck has quit IRC | 20:10 | |
ruhe | krotscheck: that seems to be specific to keystone stuff | 21:03 |
*** hashar has quit IRC | 21:14 | |
*** saju_m has quit IRC | 21:28 | |
*** mfer has quit IRC | 21:30 | |
*** che-arne has quit IRC | 21:33 | |
*** david-lyle has quit IRC | 22:19 | |
*** krotscheck has joined #storyboard | 23:30 | |
jeblair | cody-somerville: i can't speak for whether mordred was being toungue and cheek at that time, but i have heard him and enough other mysql experts say that that i personally believe he was serious. | 23:53 |
jeblair | furthermore, it is an argument that makes sense; the application needs to understand and enforce fk constraints anyway, it's wasteful to ask the db to do it as well, and tends to cause problems like this | 23:54 |
jeblair | so i do think we should get rid of foreign keys in the db; the orm should still know about those relationships though | 23:55 |
jeblair | krotscheck, ttx, mordred: ^ | 23:55 |
krotscheck | I'm all fo rit. | 23:56 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!