Skip to content
Discussion options

You must be logged in to vote

Confirmed the bug. Here's what's going on.

Root cause

The bug is in migration-expressions-between-for-sqlite3 in src/migration/table.lisp (lines 119-127). When you add a new column that has an :initform, the SQLite migration builds an INSERT INTO ... SELECT to copy rows from the old table into the new one, plugging in a default value for the new column.

Here's what happens with your column:

  1. :initform nil creates an initfunction, so (c2mop:slot-definition-initfunction slot) is non-nil and the first cond branch fires
  2. Calling the initfunction returns nil
  3. dao-table-column-deflate and convert-for-driver-type both pass nil through unchanged
  4. That nil gets stored as (cons "publication_date" nil),…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@vindarel
Comment options

@vindarel
Comment options

Answer selected by vindarel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants