Skip to content

Primary Key column has always NOT NULL after using update command #83

@marcindyjas

Description

@marcindyjas

Descripton:

Primary Key column is always not nullable after using update command but according to documentation on Cloud Spanner:
https://cloud.google.com/spanner/docs/schema-and-data-model#notes_about_key_columns
Primary Key columns can be defined to store NULLs.

Steps to reproduce:

Use changeLog as below:

databaseChangeLog:
- changeSet:
    id: 1617793276323-1
    author: author
    changes:
    - createTable:
        columns:
        - column:
            constraints:
              primaryKey: true
              primaryKeyName: PRIMARY_KEY
            name: FIRST_1
            type: STRING(1024)
        - column:
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: PRIMARY_KEY
            name: FIRST_2
            type: STRING(MAX)
        - column:
            constraints:
              primaryKey: true
              primaryKeyName: PRIMARY_KEY
            name: FIRST_3
            type: INT64
        - column:
            name: FIRST_4
            type: INT64
        tableName: FIRST_TABLE

In command:
liquibase --url="jdbc:cloudspanner:/projects/<project_name>/instances/<instance_name>/databases/<db_name>" --changeLogFile=changeLog.yml update

After that in schema you can see all Primary Keys as a not nullable but should be only FIRST_2 column.
Even adding "nullable: true" does not help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions