)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"08b72d80b55852bcb6c30a3bc7e95b9ccaa258cb","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Update models.py and add migration script to correct"},{"line_number":12,"context_line":"database schema and get rid of the difference between"},{"line_number":13,"context_line":"schema and models."},{"line_number":14,"context_line":"Remove Stack.user_credits_id nullable\u003dFalse parameter"},{"line_number":15,"context_line":"because  we can soft-delete stack, that leads to deletion"},{"line_number":16,"context_line":"user_credits and setting stack.user_credits_id to null"},{"line_number":17,"context_line":"(by cascade)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9aa7fdbe_d231aced","line":14,"updated":"2014-10-21 07:49:40.000000000","message":"s/credits/creds/g","commit_id":"270246485459291720ff0e374ef501dd6f5fa1a9"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"c641f087ab73548b4bd9b3107805bcfa87e765cc","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Update models.py and add migration script to correct"},{"line_number":12,"context_line":"database schema and get rid of the difference between"},{"line_number":13,"context_line":"schema and models."},{"line_number":14,"context_line":"Remove Stack.user_credits_id nullable\u003dFalse parameter"},{"line_number":15,"context_line":"because  we can soft-delete stack, that leads to deletion"},{"line_number":16,"context_line":"user_credits and setting stack.user_credits_id to null"},{"line_number":17,"context_line":"(by cascade)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9aa7fdbe_69b0ed43","line":14,"in_reply_to":"9aa7fdbe_d231aced","updated":"2014-10-22 11:12:57.000000000","message":"Done","commit_id":"270246485459291720ff0e374ef501dd6f5fa1a9"},{"author":{"_account_id":13323,"name":"Tatiana Kholkina","email":"tlashchova@gmail.com","username":"tlashchova"},"change_message_id":"cf5139bfc1e19ee0ed1f255891e2f9c95c553417","unresolved":false,"context_lines":[{"line_number":15,"context_line":"because  we can soft-delete stack, that leads to deletion"},{"line_number":16,"context_line":"user_credits and setting stack.user_credits_id to null"},{"line_number":17,"context_line":"(by cascade)."},{"line_number":18,"context_line":"Remove resource.id default value(in database) as specefied"},{"line_number":19,"context_line":"in models."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partially implements bp: db-sync-models-with-migrations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9aa7fdbe_99368402","line":18,"updated":"2014-10-20 15:21:07.000000000","message":"(nit) specefied --\u003e specified","commit_id":"270246485459291720ff0e374ef501dd6f5fa1a9"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"c641f087ab73548b4bd9b3107805bcfa87e765cc","unresolved":false,"context_lines":[{"line_number":15,"context_line":"because  we can soft-delete stack, that leads to deletion"},{"line_number":16,"context_line":"user_credits and setting stack.user_credits_id to null"},{"line_number":17,"context_line":"(by cascade)."},{"line_number":18,"context_line":"Remove resource.id default value(in database) as specefied"},{"line_number":19,"context_line":"in models."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partially implements bp: db-sync-models-with-migrations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9aa7fdbe_89ab51d5","line":18,"in_reply_to":"9aa7fdbe_99368402","updated":"2014-10-22 11:12:57.000000000","message":"Done","commit_id":"270246485459291720ff0e374ef501dd6f5fa1a9"}],"heat/db/sqlalchemy/migrate_repo/versions/047_add_changes_to_satisfy_models.py":[{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"e02b934729b3182d70f026fb1edecfa2c82615ad","unresolved":false,"context_lines":[{"line_number":27,"context_line":"                     \u0027ix_software_deployment_created_at\u0027,"},{"line_number":28,"context_line":"                     \u0027ix_software_deployment_server_id\u0027,"},{"line_number":29,"context_line":"                     \u0027ix_software_deployment_tenant\u0027]:"},{"line_number":30,"context_line":"                index.drop()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    if migrate_engine.name \u003d\u003d \u0027postgresql\u0027:"},{"line_number":33,"context_line":"        resource \u003d Table(\u0027resource\u0027, meta)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_ca752499","line":30,"updated":"2014-10-15 02:53:15.000000000","message":"\u003cochuprykov_\u003e asalkeld_: about indexes, i just suppose that we have correct models and possible incorrect migrations and add migrations to satisfy models. But now I see we doesn\u0027t have any indexes in models. Is it correct?\n  \u003casalkeld_\u003e ochuprykov_, afaik the indexes are not put in the models as there is no programming reason to access them\n  \u003casalkeld_\u003e they are just a db optimisation?\n  \u003casalkeld_\u003e (i am not  a db expert tho\u0027)\n  \u003cochuprykov_\u003e asalkeld_: for example, https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/models.py#L163\n  \u003casalkeld_\u003e git grep shows none of those in Heat\n  \u003casalkeld_\u003e we may just be clueless :-(\n  \u003cochuprykov_\u003e asalkeld_: i think it is correct to have migrations script and models in sync(that is the reason of my commit)\n  \u003casalkeld_\u003e but the question is which one is correct\n  \u003cochuprykov_\u003e asalkeld_: yep\n  \u003casalkeld_\u003e for the indexes I\u0027d suggest the migrations are correct\n  \u003casalkeld_\u003e shardy, ^ you know any better here\n  \u003cshardy\u003e asalkeld_: interesting, I don\u0027t know much about it tbh, presumably the sqlalchemy model needs to know about the indexes to use them?\n  \u003casalkeld_\u003e that\u0027s what ochuprykov_ recons\n  \u003cshardy\u003e stevebaker and/or SpamapS may know more\n  \u003cshardy\u003e AFAIK they\u0027re the only ones to dig into DB optimizations\n  \u003cryansb\u003e shardy: that doesn\u0027t make sense to me (that the sqla model needs to know about the indices). They mysql^Wmariadb backend should \"just work\" with queries on those indices\n  \u003cryansb\u003e also sqlalchemy has a super easy \"hey, make these indexes please\" function where you can give it model props to index\n  \u003cshardy\u003e ryansb: what are those model __table_args__ in the glance model for then?\n  \u003cryansb\u003e the glance model in heat?\n  \u003cshardy\u003e https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/models.py#L163\n  \u003cshardy\u003e The glance model referenced in the discussion above as (AIUI) an example of how to do it\n  \u003cochuprykov_\u003e its just example, that indexes are presented in models\n  \u003casalkeld_\u003e ochuprykov_, do they really need to be tho\u0027?\n  \u003cryansb\u003e shardy: TIMTOWTDI. You can define them on the model, or you can define them separately\n  \u003cochuprykov_\u003e asalkeld_: i dont know exactly\n  \u003cryansb\u003e shardy: you can also get table metadata from the engine \u0026 define indexes using that info. IMO the table_args way is more readable unless you get lots of indexes.\n  \u003cryansb\u003e hypothetically we could make some \"indices.py\" file that gets the engine and defines indices separate from the models. Downside being we\u0027d have to remember to keep it up to date.\n  \u003casalkeld_\u003e imho the less places to update the better\n  \u003cshardy\u003e asalkeld_: +1\n  \u003casalkeld_\u003e (as long as it works)\n  \u003cochuprykov_\u003e so, i have to add indexes to models, or just ignoring them during sync check?\n  \u003cshardy\u003e ochuprykov_: I think the conclusion is, if you don\u0027t know why they have to be added, don\u0027t add them ;)\n  \u003cochuprykov_\u003e shardy: and dont delete them too,","commit_id":"b2f8af22f31da2c52372a870e480e907ec5d9b20"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"143e62461680da9f84f107c629b9aaee678678c1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":3,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":4,"context_line":"#    a copy of the License at"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_c9547923","line":1,"updated":"2014-10-22 11:38:07.000000000","message":"could you please use more suitable name for this file?","commit_id":"dff9b1524039e0b1bb7a194b3d4d3c78644c5539"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"96537681e246bd9d906df447a1174e84eebc9d05","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":3,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":4,"context_line":"#    a copy of the License at"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_3700fc66","line":1,"in_reply_to":"9aa7fdbe_c9547923","updated":"2014-10-22 13:15:20.000000000","message":"Done","commit_id":"dff9b1524039e0b1bb7a194b3d4d3c78644c5539"}],"heat/db/sqlalchemy/migrate_repo/versions/048_resource_id_server_default_none_psql.py":[{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"f1c6d1d17094b56380daad74fbed89a070822f44","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":12,"context_line":"#    under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from sqlalchemy import MetaData, Sequence, Table"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def upgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a890539_6e522736","line":14,"updated":"2014-11-18 04:31:19.000000000","message":"Let\u0027s import module not the classes, fix [H302] error.","commit_id":"0c8ff8c5ee952e8977b9ab5525e1c63fc046a90b"}],"heat/db/sqlalchemy/models.py":[{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f91b267938b0c84ad5b4908743e2df590eba7842","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    parameters \u003d sqlalchemy.Column(\u0027parameters\u0027, Json)"},{"line_number":128,"context_line":"    user_creds_id \u003d sqlalchemy.Column("},{"line_number":129,"context_line":"        sqlalchemy.Integer,"},{"line_number":130,"context_line":"        sqlalchemy.ForeignKey(\u0027user_creds.id\u0027))"},{"line_number":131,"context_line":"    owner_id \u003d sqlalchemy.Column(sqlalchemy.String(36), nullable\u003dTrue)"},{"line_number":132,"context_line":"    timeout \u003d sqlalchemy.Column(sqlalchemy.Integer)"},{"line_number":133,"context_line":"    disable_rollback \u003d sqlalchemy.Column(sqlalchemy.Boolean, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_2d0a7121","line":130,"updated":"2014-10-14 01:24:07.000000000","message":"is this change intended? just up i see raw_template.id nullable\u003dFalse\nAny reason this one is different?","commit_id":"b2f8af22f31da2c52372a870e480e907ec5d9b20"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"e3b85c490cdc43fe37455f3f62f79bdf5a9ae951","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    parameters \u003d sqlalchemy.Column(\u0027parameters\u0027, Json)"},{"line_number":128,"context_line":"    user_creds_id \u003d sqlalchemy.Column("},{"line_number":129,"context_line":"        sqlalchemy.Integer,"},{"line_number":130,"context_line":"        sqlalchemy.ForeignKey(\u0027user_creds.id\u0027))"},{"line_number":131,"context_line":"    owner_id \u003d sqlalchemy.Column(sqlalchemy.String(36), nullable\u003dTrue)"},{"line_number":132,"context_line":"    timeout \u003d sqlalchemy.Column(sqlalchemy.Integer)"},{"line_number":133,"context_line":"    disable_rollback \u003d sqlalchemy.Column(sqlalchemy.Boolean, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_9a9386f9","line":130,"in_reply_to":"baa201ad_2d0a7121","updated":"2014-10-14 10:32:20.000000000","message":"Now we have user_creds_id.nullable\u003dTrue in the database(migrations).\nAlso, there are some places in the code, where it is expected expected that user_creds_id can be null. For instance: \nhttps://github.com/openstack/heat/blob/master/heat/engine/stack.py#L137\n\nhttps://github.com/openstack/heat/blob/master/heat/engine/stack.py#L941\n\nHowever, I can misunderstand something.","commit_id":"b2f8af22f31da2c52372a870e480e907ec5d9b20"},{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"9f999d033630463c662f12439456bb5db9d4df55","unresolved":false,"context_lines":[{"line_number":127,"context_line":"    parameters \u003d sqlalchemy.Column(\u0027parameters\u0027, Json)"},{"line_number":128,"context_line":"    user_creds_id \u003d sqlalchemy.Column("},{"line_number":129,"context_line":"        sqlalchemy.Integer,"},{"line_number":130,"context_line":"        sqlalchemy.ForeignKey(\u0027user_creds.id\u0027))"},{"line_number":131,"context_line":"    owner_id \u003d sqlalchemy.Column(sqlalchemy.String(36), nullable\u003dTrue)"},{"line_number":132,"context_line":"    timeout \u003d sqlalchemy.Column(sqlalchemy.Integer)"},{"line_number":133,"context_line":"    disable_rollback \u003d sqlalchemy.Column(sqlalchemy.Boolean, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_7676fa3f","line":130,"in_reply_to":"baa201ad_9a9386f9","updated":"2014-10-14 11:59:42.000000000","message":"This is true, the user_creds record gets deleted when we soft-delete a stack, so we need to set stack.user_creds_id to None when that happens.","commit_id":"b2f8af22f31da2c52372a870e480e907ec5d9b20"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"33f278863b5ed61114beaf9cf130eab36c4511bb","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import sqlalchemy"},{"line_number":23,"context_line":"from sqlalchemy.ext.declarative import declarative_base"},{"line_number":24,"context_line":"from sqlalchemy import Index"},{"line_number":25,"context_line":"from sqlalchemy.orm import backref"},{"line_number":26,"context_line":"from sqlalchemy.orm import relationship"},{"line_number":27,"context_line":"from sqlalchemy.orm.session import Session"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_49b3ee09","line":24,"updated":"2014-10-24 07:44:33.000000000","message":"Please don\u0027t import Index class directly to avoid H302 error, we have imported sqlalchemy at L22, you can just use sqlalchemy.Index.\n\nhttp://docs.openstack.org/developer/hacking/#imports","commit_id":"ce1f5d30fa9c794db35f8be71e6b2695c9d27a71"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"a6b1ebd6efe4b8b9265625584e7de53d8416e0f6","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import sqlalchemy"},{"line_number":23,"context_line":"from sqlalchemy.ext.declarative import declarative_base"},{"line_number":24,"context_line":"from sqlalchemy import Index"},{"line_number":25,"context_line":"from sqlalchemy.orm import backref"},{"line_number":26,"context_line":"from sqlalchemy.orm import relationship"},{"line_number":27,"context_line":"from sqlalchemy.orm.session import Session"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_bbcbbb51","line":24,"in_reply_to":"9aa7fdbe_49b3ee09","updated":"2014-10-24 09:54:43.000000000","message":"I see sqlalchemy package in exceptions to this rule.","commit_id":"ce1f5d30fa9c794db35f8be71e6b2695c9d27a71"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"70540a503d9c2696b441bd62e07baec540c05187","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import sqlalchemy"},{"line_number":23,"context_line":"from sqlalchemy.ext.declarative import declarative_base"},{"line_number":24,"context_line":"from sqlalchemy import Index"},{"line_number":25,"context_line":"from sqlalchemy.orm import backref"},{"line_number":26,"context_line":"from sqlalchemy.orm import relationship"},{"line_number":27,"context_line":"from sqlalchemy.orm.session import Session"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_3e3979a4","line":24,"in_reply_to":"9aa7fdbe_bbcbbb51","updated":"2014-10-24 10:15:43.000000000","message":"Agree with Zhenguo Niu - there is no imports of SQLAlchemy types in this file, so let\u0027s keep this convention","commit_id":"ce1f5d30fa9c794db35f8be71e6b2695c9d27a71"}]}
