Skip to content

Commit

Permalink
fix a missing case
Browse files Browse the repository at this point in the history
  • Loading branch information
Gil Mizrahi committed Jan 19, 2024
1 parent ee53c86 commit e730292
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ fn check_columns(
) -> Result<(), Error> {
for (name, column) in columns.iter() {
match column {
// nullable and identity by default columns can be inserted into or omitted.
// nullable, default, and identity by default columns can be inserted into or omitted.
database::ColumnInfo {
nullable: database::Nullable::Nullable,
..
}
| database::ColumnInfo {
has_default: database::HasDefault::HasDefault,
..
}
| database::ColumnInfo {
is_identity: database::IsIdentity::IdentityByDefault,
..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ expression: default_configuration
"birthday": {
"name": "birthday",
"type": "date",
"nullable": "nullable",
"nullable": "nonNullable",
"description": null
},
"height_cm": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ expression: default_configuration
"type": {
"scalarType": "date"
},
"nullable": "nullable",
"nullable": "nonNullable",
"hasDefault": "hasDefault",
"description": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2109,11 +2109,8 @@ expression: result
},
"birthday": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "date"
}
"type": "named",
"name": "date"
}
},
"height_cm": {
Expand Down Expand Up @@ -2960,11 +2957,8 @@ expression: result
},
"birthday": {
"type": {
"type": "nullable",
"underlying_type": {
"type": "named",
"name": "date"
}
"type": "named",
"name": "date"
}
},
"height_cm": {
Expand Down
2 changes: 1 addition & 1 deletion static/custom-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ create schema custom;
create table custom.dog (
id bigint primary key generated always as identity,
name text not null,
birthday date default '2024-01-17',
birthday date not null default '2024-01-17',
adopter_name text null,
height_cm numeric not null,
height_in numeric GENERATED ALWAYS AS (height_cm / 2.54) STORED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
"type": {
"scalarType": "date"
},
"nullable": "nullable",
"nullable": "nonNullable",
"hasDefault": "hasDefault",
"description": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"birthday": {
"name": "birthday",
"type": "date",
"nullable": "nullable",
"nullable": "nonNullable",
"description": null
},
"height_cm": {
Expand Down
2 changes: 1 addition & 1 deletion static/postgres/v1-chinook-deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"birthday": {
"name": "birthday",
"type": "date",
"nullable": "nullable",
"nullable": "nonNullable",
"description": null
},
"height_cm": {
Expand Down
2 changes: 1 addition & 1 deletion static/postgres/v2-chinook-deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
"type": {
"scalarType": "date"
},
"nullable": "nullable",
"nullable": "nonNullable",
"hasDefault": "hasDefault",
"description": null
},
Expand Down

0 comments on commit e730292

Please sign in to comment.