You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Aleksei Kovura (JIRA)" <ji...@apache.org> on 2016/03/31 10:37:25 UTC

[jira] [Updated] (DERBY-6882) Add functionality to ALTER TABLE: switch from GENERATED ALWAYS to GENERATED BY DEFAULT

     [ https://issues.apache.org/jira/browse/DERBY-6882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksei Kovura updated DERBY-6882:
----------------------------------
    Description: 
I'm trying to import data from another Derby database with foreignViews tool because system tables got corrupted somehow (see https://issues.apache.org/jira/browse/DERBY-6876). Tables contain generated ID columns (created as "GENERATED ALWAYS"). Importing data and allowing Derby to generate new IDs in generated columns will break relationships between tables (old tables have counter gaps there due to deletes - IDs won't match).
For a clean import without breaking DDL information in DB version control I would like to be able to switch between generated types as follows:
 
ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED BY DEFAULT
ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED ALWAYS

  was:
I'm trying to import data from another Derby database with foreignViews tool because system tables got corrupted somehow (see https://issues.apache.org/jira/browse/DERBY-6876). Tables contain generated ID columns (created as "GENERATED ALWAYS"). Importing data and allowing Derby to generate new IDs in generated columns will break relationships between tables (old tables have counter gaps there due to deletes - IDs won't match).
For a clean import without breaking DDL information in DB version control I would like to be able to switch between generated types as follows:
 
ALTER TABLE ALTER COLUMN col1 SET GENERATED BY DEFAULT
ALTER TABLE ALTER COLUMN col1 SET GENERATED ALWAYS


> Add functionality to ALTER TABLE: switch from GENERATED ALWAYS to GENERATED BY DEFAULT
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-6882
>                 URL: https://issues.apache.org/jira/browse/DERBY-6882
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.12.1.1
>            Reporter: Aleksei Kovura
>              Labels: features
>
> I'm trying to import data from another Derby database with foreignViews tool because system tables got corrupted somehow (see https://issues.apache.org/jira/browse/DERBY-6876). Tables contain generated ID columns (created as "GENERATED ALWAYS"). Importing data and allowing Derby to generate new IDs in generated columns will break relationships between tables (old tables have counter gaps there due to deletes - IDs won't match).
> For a clean import without breaking DDL information in DB version control I would like to be able to switch between generated types as follows:
>  
> ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED BY DEFAULT
> ALTER TABLE table1 ALTER COLUMN col1 SET GENERATED ALWAYS



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)