Mark Struberg created OPENJPA-2876: -------------------------------------- Summary: running 'refresh' schema action creates wrong SQL output Key: OPENJPA-2876 URL: https://issues.apache.org/jira/browse/OPENJPA-2876 Project: OpenJPA Issue Type: Bug Components: sql Affects Versions: 3.0.0 Reporter: Mark Struberg Assignee: Mark Struberg Fix For: 3.2.1
Seems we trashed the SQL refresh feature along the way to JPA-2.0. I have a sample with an Entity 'Customer' with just an ID. Then I add a column {{OTHER_NAME}} and generate the result with {{sqlAction=refresh}} In OpenJPA-2.4.3 we get the following output: {noformat} ALTER TABLE CUSTOMER ADD COLUMN OTHER_NAME VARCHAR(255); {noformat} In OpenJPA-3.0.0 onwards we get this: {noformat} ALTER TABLE CUSTOMER ADD COLUMN OTHER_NAME VARCHAR(255); CREATE TABLE CUSTOMER (ID BIGINT NOT NULL, active VARCHAR(1), OTHER_NAME VARCHAR(255), specialCustomer VARCHAR(1) NOT NULL, PRIMARY KEY (ID)); CREATE TABLE OPENJPA_SEQUENCE_TABLE (ID TINYINT NOT NULL, SEQUENCE_VALUE BIGINT, PRIMARY KEY (ID)); CREATE TABLE PUBLIC.CUSTOMER (ID BIGINT, ACTIVE VARCHAR(1), NAME VARCHAR(255), SPECIALCUSTOMER VARCHAR(1)); {noformat} It seems like we do not only run the MappingAction 'refresh' but also a 'build' plus we do it also without Schema and with the current Schema (PUBLIC). -- This message was sent by Atlassian Jira (v8.3.4#803005)