I am trying to programmatically generate tables based on some classes in c#. I have my c# code autodetect changes in the classes (in this case Missile), and update the table if there are any property changes.
The sqlite code I am using is based off of CJH's response to a similar question.
I added the column stackLimit, which seems to be causing problems.
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE Missile_backup(itemName, description, itemType, itemSubType, itemSubType2, itemID, classID, missileSpeed, flightTime, cost, volume, mass);
INSERT INTO Missile_backup SELECT itemName, description, itemType, itemSubType, itemSubType2, itemID, classID, missileSpeed, flightTime, cost, volume, mass FROM Missile;
DROP TABLE Missile;
CREATE TABLE Missile(itemName, description, itemType, itemSubType, itemSubType2, stackLimit, itemID, classID, missileSpeed, flightTime, cost, volume, mass);
INSERT INTO Missile SELECT itemName, description, itemType, itemSubType, itemSubType2, itemID, classID, missileSpeed, flightTime, cost, volume, mass FROM Missile_backup;
DROP TABLE Missile_backup;
COMMIT;
So whenever I create the new version of missile with the additional stackLimit column, and copy over the old information, I get an error:
table Missile has 13 columns but 12 values were supplied
Was his example just incorrect? Or am I missing something? All I want to do is fill the unspecified column here (stackLimit) with null for now.
But in the future it could be several columns, and they would need to be null, so it would need to be automatic.
Thanks