{"action":"created","issue":{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/2578","repository_url":"https://api.github.com/repos/camptocamp/c2cgeoportal","labels_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/2578/labels{/name}","comments_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/2578/comments","events_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/2578/events","html_url":"https://github.com/camptocamp/c2cgeoportal/issues/2578","id":181613776,"number":2578,"title":"Errors when upgrading database with alembic scripts","user":{"login":"rbovard","id":4549666,"avatar_url":"https://avatars.githubusercontent.com/u/4549666?v=3","gravatar_id":"","url":"https://api.github.com/users/rbovard","html_url":"https://github.com/rbovard","followers_url":"https://api.github.com/users/rbovard/followers","following_url":"https://api.github.com/users/rbovard/following{/other_user}","gists_url":"https://api.github.com/users/rbovard/gists{/gist_id}","starred_url":"https://api.github.com/users/rbovard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbovard/subscriptions","organizations_url":"https://api.github.com/users/rbovard/orgs","repos_url":"https://api.github.com/users/rbovard/repos","events_url":"https://api.github.com/users/rbovard/events{/privacy}","received_events_url":"https://api.github.com/users/rbovard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-10-07T08:41:04Z","updated_at":"2016-10-07T13:30:30Z","closed_at":null,"body":"Still during step 4...:\r\n\r\n```\r\nINFO  [alembic.runtime.migration] Context impl PostgresqlImpl.\r\nINFO  [alembic.runtime.migration] Will assume transactional DDL.\r\nINFO  [alembic.runtime.migration] Running upgrade 29f2a32859ec -> 951ff84bd8ec, Be able to delete a WMS layer in SQL\r\nTraceback (most recent call last):\r\n  File \".build/venv/bin/c2ctool\", line 11, in <module>\r\n    sys.exit(main())\r\n  File \".build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py\", line 98, in main\r\n    c2ctool.upgrade()\r\n  File \".build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py\", line 222, in upgrade\r\n    self.step4()\r\n  File \".build/venv/local/lib/python2.7/site-packages/c2cgeoportal/scripts/c2ctool.py\", line 438, in step4\r\n    command.upgrade(Config(\"alembic.ini\"), \"head\")\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/command.py\", line 174, in upgrade\r\n    script.run_env()\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/script/base.py\", line 407, in run_env\r\n    util.load_python_file(self.dir, 'env.py')\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/util/pyfiles.py\", line 93, in load_python_file\r\n    module = load_module_py(module_id, path)\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/util/compat.py\", line 79, in load_module_py\r\n    mod = imp.load_source(module_id, path, fp)\r\n  File \"CONST_alembic/main/env.py\", line 109, in <module>\r\n    run_migrations_online()\r\n  File \"CONST_alembic/main/env.py\", line 102, in run_migrations_online\r\n    context.run_migrations()\r\n  File \"<string>\", line 8, in run_migrations\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/runtime/environment.py\", line 797, in run_migrations\r\n    self.get_context().run_migrations(**kw)\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/runtime/migration.py\", line 312, in run_migrations\r\n    step.migration_fn(**kw)\r\n  File \"CONST_alembic/main/versions/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py\", line 80, in upgrade\r\n    'layer_id_fkey', 'layer', schema=schema,\r\n  File \"<string>\", line 8, in drop_constraint\r\n  File \"<string>\", line 3, in drop_constraint\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/operations/ops.py\", line 145, in drop_constraint\r\n    return operations.invoke(op)\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/operations/base.py\", line 318, in invoke\r\n    return fn(self, operation)\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/operations/toimpl.py\", line 146, in drop_constraint\r\n    schema=operation.schema,\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py\", line 183, in drop_constraint\r\n    self._exec(schema.DropConstraint(const))\r\n  File \".build/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py\", line 118, in _exec\r\n    return conn.execute(construct, *multiparams, **params)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 914, in execute\r\n    return meth(self, multiparams, params)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py\", line 68, in _execute_on_connection\r\n    return connection._execute_ddl(self, multiparams, params)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 968, in _execute_ddl\r\n    compiled\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1146, in _execute_context\r\n    context)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1341, in _handle_dbapi_exception\r\n    exc_info\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py\", line 202, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \".build/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py\", line 450, in do_execute\r\n    cursor.execute(statement, parameters)\r\nsqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) constraint \"layer_id_fkey\" of relation \"layer\" does not exist\r\n [SQL: 'ALTER TABLE main.layer DROP CONSTRAINT layer_id_fkey']\r\nCONST_Makefile:1237: recipe for target 'upgrade4' failed\r\nmake: *** [upgrade4] Error 1\r\n```"},"comment":{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/comments/252252375","html_url":"https://github.com/camptocamp/c2cgeoportal/issues/2578#issuecomment-252252375","issue_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/2578","id":252252375,"user":{"login":"rbovard","id":4549666,"avatar_url":"https://avatars.githubusercontent.com/u/4549666?v=3","gravatar_id":"","url":"https://api.github.com/users/rbovard","html_url":"https://github.com/rbovard","followers_url":"https://api.github.com/users/rbovard/followers","following_url":"https://api.github.com/users/rbovard/following{/other_user}","gists_url":"https://api.github.com/users/rbovard/gists{/gist_id}","starred_url":"https://api.github.com/users/rbovard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbovard/subscriptions","organizations_url":"https://api.github.com/users/rbovard/orgs","repos_url":"https://api.github.com/users/rbovard/repos","events_url":"https://api.github.com/users/rbovard/events{/privacy}","received_events_url":"https://api.github.com/users/rbovard/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T13:30:30Z","updated_at":"2016-10-07T13:30:30Z","body":"What's the purpose of this constraint?"}}
{"actor":{"display_login":"rbovard"}}