Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow userdb.usernick to be NULL
Otherwise guest checkout doesn't work.
  • Loading branch information
jonjensen committed Nov 2, 2017
1 parent 3b68969 commit 57f71fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/strap/dbconf/mysql/userdb.mysql
@@ -1,7 +1,7 @@
Database userdb userdb.txt __SQLDSN__
Database userdb DEFAULT_TYPE varchar(255)
Database userdb COLUMN_DEF "username=varchar(255) NOT NULL PRIMARY KEY"
Database userdb COLUMN_DEF "usernick=varchar(255) NOT NULL"
Database userdb COLUMN_DEF "usernick=varchar(255)"
Database userdb COLUMN_DEF "password=varchar(64) NOT NULL"
Database userdb COLUMN_DEF "expiration=varchar(32)"
Database userdb COLUMN_DEF "accounts=BLOB"
Expand Down
2 changes: 1 addition & 1 deletion dist/strap/dbconf/pgsql/userdb.pgsql
Expand Up @@ -3,7 +3,7 @@ Database userdb LENGTH_EXCEPTION_DEFAULT truncate_log
Database userdb DEFAULT_TYPE varchar(255)

Database userdb COLUMN_DEF "username=varchar(255) NOT NULL PRIMARY KEY"
Database userdb COLUMN_DEF "usernick=varchar(255) NOT NULL"
Database userdb COLUMN_DEF "usernick=varchar(255)"
Database userdb COLUMN_DEF "password=varchar(64)"
Database userdb COLUMN_DEF "expiration=varchar(32)"
Database userdb COLUMN_DEF "accounts=text"
Expand Down
2 changes: 1 addition & 1 deletion dist/strap/dbconf/sqlite/userdb.lite
Expand Up @@ -2,7 +2,7 @@ Database userdb userdb.txt __SQLDSN__
Database userdb DEFAULT_TYPE varchar(255)

Database userdb COLUMN_DEF "username=varchar(255) NOT NULL PRIMARY KEY"
Database userdb COLUMN_DEF "usernick=varchar(255) NOT NULL"
Database userdb COLUMN_DEF "usernick=varchar(255)"
Database userdb COLUMN_DEF "password=varchar(64)"
Database userdb COLUMN_DEF "expiration=varchar(32)"
Database userdb COLUMN_DEF "accounts=text"
Expand Down

1 comment on commit 57f71fe

@jlav1n
Copy link
Contributor

@jlav1n jlav1n commented on 57f71fe Nov 3, 2017

Choose a reason for hiding this comment

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

This is necessary because of Interchange's pattern of first inserting a row with 1 or 2 columns, then coming back a second time to flesh out the rest of the columns.

The Interchange New-Account process thus fails to set a value for the usernick field, which causes errors such as:

set_row error as called by Vend::Table::DBI: DBD::Pg::db do failed: ERROR: null value in column "usernick" violates not-null constraint

This is not an issue with MySQL, go figure.

In an ideal world, we would fix the underlying Interchange "insert" method, because we value database integrity -- if you are writing a NULL to the usernick column, you are doing it wrong... -- but this is the acceptable solution for now.

Please sign in to comment.