Skip to content

Cannot specify date and time in TIMESTAMP type field with allow_commit_timestamp=true #174

Description

@bemarble

Cannot specify date and time in TIMESTAMP type field with allow_commit_timestamp=true.
Spanner's SQL spec allows past dates and times to be registered for TIMESTAMP type fields with allow_commit_timestamp=true, but spanner.CommitTimestamp is set when using the code generated by yo.
In the following code, CreatedAt is expected to be updated only once

example

CREATE TABLE User (
  Id STRING(MAX) NOT NULL
  Name STRING(MAX) NOT NULL,
  CreatedAt TIMESTAMP NOT NULL OPTIONS (
    allow_commit_timestamp = true
  ),
  UpdatedAt TIMESTAMP NOT NULL OPTIONS (
    allow_commit_timestamp = true
  )
) PRIMARY KEY(Id);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions