Commit 9e0e38ad authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Don't hardcode identifiers in pre-defined values in akonadidb.xml

PostgreSQL does not increment the internal autoincrement counter for
primary keys if the key value is explicitly specified in INSERT statement.
parent 37817e26
......@@ -66,7 +66,7 @@
<table name="SchemaVersion">
<comment>Contains the schema version of the database.</comment>
<column name="version" type="int" default="0" allowNull="false"/>
<data columns="version" values="32"/>
<data columns="version" values="33"/>
</table>
<table name="Resource">
......@@ -181,7 +181,7 @@
<table name="TagType">
<column name="id" type="qint64" allowNull="false" isAutoIncrement="true" isPrimaryKey="true"/>
<column name="name" type="QString" allowNull="false" isUnique="true"/>
<data columns="id,name" values="1,'PLAIN'"/>
<data columns="name" values="'PLAIN'"/>
</table>
<table name="Tag">
......@@ -209,7 +209,7 @@
<table name="RelationType">
<column name="id" type="qint64" allowNull="false" isAutoIncrement="true" isPrimaryKey="true"/>
<column name="name" type="QString" allowNull="false" isUnique="true"/>
<data columns="id,name" values="1,'GENERIC'"/>
<data columns="name" values="'GENERIC'"/>
</table>
<table name="Relation" identificationColumn="">
......
......@@ -316,4 +316,8 @@
WHERE PimItemTable.id IS NULL) x)
</raw-sql>
</update>
<update version="33" abortOnFailure="false">
<raw-sql backends="psql">SELECT setval('tagtypetable_pkey', (SELECT max(id) FROM TagTypeTable))</raw-sql>
<raw-sql backends="psql">SELECT setval('relationtypetable_pkey', (SELECT max(id) FROM RelationTypeTable))</raw-sql>
</update>
</updates>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment