Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: EXPOSED-278 Invalid Oracle statement when adding a new column that is used in a primary key #2259

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joc-a
Copy link
Collaborator

@joc-a joc-a commented Sep 26, 2024

Description

  • What:
    DDL for column in Oracle has changed when it is part of a primary key constraint.
  • Why:
    When adding a new column to an existing table in Oracle, if that new column is used in a primary key, then a separate statement is needed for the primary key otherwise there will be a syntax error. Previously, adding the column and the constraint was being done in one statement.
  • How:
    In createStatement() in Column, a check was added for Oracle to include a separate statement when there is a primary constraint to be added.

Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

@joc-a joc-a marked this pull request as ready for review September 26, 2024 14:06
Copy link
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note about breaking changes to doc so it's not forgotten later. All links to breaking changes goes to the site version, which won't be synced until the release, so it's ok to update with every relevant PR.

…hat is used in a primary key

When adding a new column to an existing table in Oracle, if that new column is used in a primary key, then a separate statement is needed for the primary key otherwise there will be a syntax error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants