frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.68k stars 614 forks source link

alter table Payment add column referenceType text not null - Cannot add a NOT NULL column with default value NULL #777

Closed AballahNsour closed 7 months ago

AballahNsour commented 7 months ago

Description

Add some description...

Steps to Reproduce

Add steps to reproduce the error...

Info

Error: DatabaseError: SqliteError alter table Payment add column referenceType text not null - Cannot add a NOT NULL column with default value NULL

Stack:


SqliteError: alter table `Payment` add column `referenceType` text not null - Cannot add a NOT NULL column with default value NULL
    at Function.get (/Users/abdallah/Desktop/Developer/Accounting/books/node_modules/knex/lib/knex-builder/make-knex.js:43:26)
    at DatabaseCore.
mildred commented 7 months ago

This is from the master branch, caused by #743

Either stop marking the field as required, and update code to gracefully handle NULL values, or provide a default value, or find a way to migrate the data and programatically provide the value for this field

mildred commented 7 months ago

In the meantime use a previous version of Books