Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 49A78200BCB for ; Thu, 24 Nov 2016 10:23:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 48084160B1E; Thu, 24 Nov 2016 09:23:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 88193160B11 for ; Thu, 24 Nov 2016 10:22:59 +0100 (CET) Received: (qmail 31508 invoked by uid 500); 24 Nov 2016 09:22:58 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 31497 invoked by uid 99); 24 Nov 2016 09:22:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Nov 2016 09:22:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 911032C03E2 for ; Thu, 24 Nov 2016 09:22:58 +0000 (UTC) Date: Thu, 24 Nov 2016 09:22:58 +0000 (UTC) From: "ana benko (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAY-2154) Migrate db: queries order MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 24 Nov 2016 09:23:00 -0000 ana benko created CAY-2154: ------------------------------ Summary: Migrate db: queries order Key: CAY-2154 URL: https://issues.apache.org/jira/browse/CAY-2154 Project: Cayenne Issue Type: Bug Components: Modeler Affects Versions: 4.0.M4 Reporter: ana benko 1. Reverse Engineer db, that has eg. Salary dbEntity 2. Add eg. dept_id column to Salary 3. Add new Dept dbEntity, add id column 4. Join Salary and Dept entities by 1->many relationship. Save 5. Migrate Db, view Generated SQL tab -> migrate first attempts to create FK, and only then adds new column ALTER TABLE testdb.salary ADD FOREIGN KEY (dept_id) REFERENCES dept (id); ALTER TABLE testdb.salary ADD COLUMN dept_id INT; which results in a error -- This message was sent by Atlassian JIRA (v6.3.4#6332)