This simple sql line
gives error: "UNIQUE constraint failed". Anyone knows why?Code:UPDATE Government_SlotCounts SET GovernmentSlotType = 'SLOT_WILDCARD';
DELETE FROM Government_SlotCounts;
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_CHIEFDOM', 'SLOT_WILDCARD', 2);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_AUTOCRACY', 'SLOT_WILDCARD', 4);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_OLIGARCHY', 'SLOT_WILDCARD', 4);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_CLASSICAL_REPUBLIC', 'SLOT_WILDCARD', 4);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_MONARCHY', 'SLOT_WILDCARD', 6);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_THEOCRACY', 'SLOT_WILDCARD', 6);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_MERCHANT_REPUBLIC', 'SLOT_WILDCARD', 6);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_FASCISM', 'SLOT_WILDCARD', 8);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_COMMUNISM', 'SLOT_WILDCARD', 8);
INSERT INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots) VALUES ('GOVERNMENT_DEMOCRACY', 'SLOT_WILDCARD', 8);
It's in the Governments.xml file which is what the UPDATE references
I want to replace every diplomacy slot with a wildcard one.If you want to make every slot a WildCard...
What?It's in the Governments.xml file which is what the UPDATE references
%USERPROFILE%\Documents\my games\Sid Meier's Civilization VI\Logs\Database.logHow are you even able to view these errors? I need help debugging.
REPLACE INTO Government_SlotCounts (GovernmentType, GovernmentSlotType, NumSlots)
SELECT a.GovernmentType, 'SLOT_WILDCARD', a.NumSlots + b.NumSlots
FROM Government_SlotCounts AS a, Government_SlotCounts AS b
WHERE a.GovernmentType = b.GovernmentType
AND a.GovernmentSlotType = 'SLOT_DIPLOMATIC'
AND b.GovernmentSlotType = 'SLOT_WILDCARD';
DELETE FROM Government_SlotCounts
WHERE GovernmentSlotType = 'SLOT_DIPLOMATIC';
@qqqbbb is absolutely correct in this. The definition of table <Governments> is as follows:There is no GovernmentSlotType column in Governments table.
CREATE TABLE "Governments" (
"GovernmentType" TEXT NOT NULL,
"Name" TEXT NOT NULL,
"PrereqCivic" TEXT,
"InherentBonusDesc" TEXT NOT NULL,
"AccumulatedBonusShortDesc" TEXT NOT NULL,
"AccumulatedBonusDesc" TEXT NOT NULL,
"OtherGovernmentIntolerance" INTEGER NOT NULL DEFAULT 0,
"InfluencePointsPerTurn" INTEGER NOT NULL,
"InfluencePointsThreshold" INTEGER NOT NULL,
"InfluenceTokensPerThreshold" INTEGER NOT NULL,
"BonusType" TEXT NOT NULL,
PRIMARY KEY(GovernmentType),
FOREIGN KEY (PrereqCivic) REFERENCES Civics(CivicType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
FOREIGN KEY (BonusType) REFERENCES GovernmentBonusNames(GovernmentBonusType) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT,
FOREIGN KEY (GovernmentType) REFERENCES Types(Type) ON DELETE CASCADE ON UPDATE CASCADE);
<Components>
<UpdateDatabase id="xxxxxxxxxxxxxx">
<Items>
<File>Filename.xml</File>
<File>Filename.sql</File>
</Items>
</UpdateDatabase>
</Components>
<Settings>
<Custom id="SETTINGS">
<Items>
<File>Config.xml</File>
<File>Config.sql</File>
</Items>
</Custom>
</Settings>