mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
undelete note WIP
This commit is contained in:
parent
c1d0a1e07b
commit
14f3c783f2
@ -2,7 +2,7 @@
|
|||||||
<dataSource name="document.db">
|
<dataSource name="document.db">
|
||||||
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.17">
|
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.17">
|
||||||
<root id="1">
|
<root id="1">
|
||||||
<ServerVersion>3.16.1</ServerVersion>
|
<ServerVersion>3.25.1</ServerVersion>
|
||||||
</root>
|
</root>
|
||||||
<schema id="2" parent="1" name="main">
|
<schema id="2" parent="1" name="main">
|
||||||
<Current>1</Current>
|
<Current>1</Current>
|
||||||
@ -57,6 +57,7 @@
|
|||||||
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
|
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>apiTokenId</ColNames>
|
<ColNames>apiTokenId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="25" parent="6">
|
<key id="25" parent="6">
|
||||||
@ -111,529 +112,573 @@
|
|||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="35" parent="7" name="hash">
|
<column id="35" parent="7" name="deleteId">
|
||||||
<Position>10</Position>
|
<Position>10</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
|
<DefaultExpression>NULL</DefaultExpression>
|
||||||
|
</column>
|
||||||
|
<column id="36" parent="7" name="hash">
|
||||||
|
<Position>11</Position>
|
||||||
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="36" parent="7" name="isInheritable">
|
<column id="37" parent="7" name="isInheritable">
|
||||||
<Position>11</Position>
|
<Position>12</Position>
|
||||||
<DataType>int|0s</DataType>
|
<DataType>int|0s</DataType>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<index id="37" parent="7" name="sqlite_autoindex_attributes_1">
|
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>attributeId</ColNames>
|
<ColNames>attributeId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="38" parent="7" name="IDX_attributes_noteId_index">
|
<index id="39" parent="7" name="IDX_attributes_noteId_index">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="39" parent="7" name="IDX_attributes_name_value">
|
<index id="40" parent="7" name="IDX_attributes_name_value">
|
||||||
<ColNames>name
|
<ColNames>name
|
||||||
value</ColNames>
|
value</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="40" parent="7" name="IDX_attributes_value_index">
|
<index id="41" parent="7" name="IDX_attributes_value_index">
|
||||||
<ColNames>value</ColNames>
|
<ColNames>value</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="41" parent="7">
|
<key id="42" parent="7">
|
||||||
<ColNames>attributeId</ColNames>
|
<ColNames>attributeId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="42" parent="8" name="branchId">
|
<column id="43" parent="8" name="branchId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="43" parent="8" name="noteId">
|
<column id="44" parent="8" name="noteId">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="44" parent="8" name="parentNoteId">
|
<column id="45" parent="8" name="parentNoteId">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="45" parent="8" name="notePosition">
|
<column id="46" parent="8" name="notePosition">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="46" parent="8" name="prefix">
|
<column id="47" parent="8" name="prefix">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="47" parent="8" name="isExpanded">
|
<column id="48" parent="8" name="isExpanded">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="48" parent="8" name="isDeleted">
|
<column id="49" parent="8" name="isDeleted">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="49" parent="8" name="utcDateModified">
|
<column id="50" parent="8" name="deleteId">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<DefaultExpression>NULL</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="50" parent="8" name="utcDateCreated">
|
<column id="51" parent="8" name="utcDateModified">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="51" parent="8" name="hash">
|
<column id="52" parent="8" name="utcDateCreated">
|
||||||
<Position>10</Position>
|
<Position>10</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
|
</column>
|
||||||
|
<column id="53" parent="8" name="hash">
|
||||||
|
<Position>11</Position>
|
||||||
|
<DataType>TEXT|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<index id="52" parent="8" name="sqlite_autoindex_branches_1">
|
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>branchId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="53" parent="8" name="IDX_branches_noteId_parentNoteId">
|
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
|
||||||
<ColNames>noteId
|
<ColNames>noteId
|
||||||
parentNoteId</ColNames>
|
parentNoteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="54" parent="8" name="IDX_branches_parentNoteId">
|
<index id="56" parent="8" name="IDX_branches_parentNoteId">
|
||||||
<ColNames>parentNoteId</ColNames>
|
<ColNames>parentNoteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="55" parent="8">
|
<key id="57" parent="8">
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>branchId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="56" parent="9" name="noteId">
|
<column id="58" parent="9" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="57" parent="9" name="content">
|
<column id="59" parent="9" name="content">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<DefaultExpression>NULL</DefaultExpression>
|
<DefaultExpression>NULL</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="58" parent="9" name="hash">
|
<column id="60" parent="9" name="hash">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="59" parent="9" name="utcDateModified">
|
<column id="61" parent="9" name="utcDateModified">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="60" parent="9" name="sqlite_autoindex_note_contents_1">
|
<index id="62" parent="9" name="sqlite_autoindex_note_contents_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="61" parent="9">
|
<key id="63" parent="9">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="62" parent="10" name="noteRevisionId">
|
<column id="64" parent="10" name="noteRevisionId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="63" parent="10" name="content">
|
<column id="65" parent="10" name="content">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="64" parent="10" name="hash">
|
<column id="66" parent="10" name="hash">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
<DefaultExpression>''</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="65" parent="10" name="utcDateModified">
|
<column id="67" parent="10" name="utcDateModified">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="66" parent="10" name="sqlite_autoindex_note_revision_contents_1">
|
<index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteRevisionId</ColNames>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="67" parent="10">
|
<key id="69" parent="10">
|
||||||
<ColNames>noteRevisionId</ColNames>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_note_revision_contents_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_note_revision_contents_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="68" parent="11" name="noteRevisionId">
|
<column id="70" parent="11" name="noteRevisionId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="69" parent="11" name="noteId">
|
<column id="71" parent="11" name="noteId">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="70" parent="11" name="title">
|
<column id="72" parent="11" name="title">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="71" parent="11" name="contentLength">
|
<column id="73" parent="11" name="contentLength">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="72" parent="11" name="isErased">
|
<column id="74" parent="11" name="isErased">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="73" parent="11" name="isProtected">
|
<column id="75" parent="11" name="isProtected">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="74" parent="11" name="utcDateLastEdited">
|
<column id="76" parent="11" name="utcDateLastEdited">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="75" parent="11" name="utcDateCreated">
|
<column id="77" parent="11" name="utcDateCreated">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="76" parent="11" name="utcDateModified">
|
<column id="78" parent="11" name="utcDateModified">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="77" parent="11" name="dateLastEdited">
|
<column id="79" parent="11" name="dateLastEdited">
|
||||||
<Position>10</Position>
|
<Position>10</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="78" parent="11" name="dateCreated">
|
<column id="80" parent="11" name="dateCreated">
|
||||||
<Position>11</Position>
|
<Position>11</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="79" parent="11" name="type">
|
<column id="81" parent="11" name="type">
|
||||||
<Position>12</Position>
|
<Position>12</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
<DefaultExpression>''</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="80" parent="11" name="mime">
|
<column id="82" parent="11" name="mime">
|
||||||
<Position>13</Position>
|
<Position>13</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
<DefaultExpression>''</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="81" parent="11" name="hash">
|
<column id="83" parent="11" name="hash">
|
||||||
<Position>14</Position>
|
<Position>14</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
<DefaultExpression>''</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<index id="82" parent="11" name="sqlite_autoindex_note_revisions_1">
|
<index id="84" parent="11" name="sqlite_autoindex_note_revisions_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteRevisionId</ColNames>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="83" parent="11" name="IDX_note_revisions_noteId">
|
<index id="85" parent="11" name="IDX_note_revisions_noteId">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="84" parent="11" name="IDX_note_revisions_utcDateLastEdited">
|
<index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited">
|
||||||
<ColNames>utcDateLastEdited</ColNames>
|
<ColNames>utcDateLastEdited</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="85" parent="11" name="IDX_note_revisions_utcDateCreated">
|
<index id="87" parent="11" name="IDX_note_revisions_utcDateCreated">
|
||||||
<ColNames>utcDateCreated</ColNames>
|
<ColNames>utcDateCreated</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="86" parent="11" name="IDX_note_revisions_dateLastEdited">
|
<index id="88" parent="11" name="IDX_note_revisions_dateLastEdited">
|
||||||
<ColNames>dateLastEdited</ColNames>
|
<ColNames>dateLastEdited</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="87" parent="11" name="IDX_note_revisions_dateCreated">
|
<index id="89" parent="11" name="IDX_note_revisions_dateCreated">
|
||||||
<ColNames>dateCreated</ColNames>
|
<ColNames>dateCreated</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="88" parent="11">
|
<key id="90" parent="11">
|
||||||
<ColNames>noteRevisionId</ColNames>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="89" parent="12" name="noteId">
|
<column id="91" parent="12" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="90" parent="12" name="title">
|
<column id="92" parent="12" name="title">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>"note"</DefaultExpression>
|
<DefaultExpression>"note"</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="91" parent="12" name="contentLength">
|
<column id="93" parent="12" name="contentLength">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="92" parent="12" name="isProtected">
|
<column id="94" parent="12" name="isProtected">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="93" parent="12" name="type">
|
<column id="95" parent="12" name="type">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'text'</DefaultExpression>
|
<DefaultExpression>'text'</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="94" parent="12" name="mime">
|
<column id="96" parent="12" name="mime">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'text/html'</DefaultExpression>
|
<DefaultExpression>'text/html'</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="95" parent="12" name="hash">
|
<column id="97" parent="12" name="hash">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="96" parent="12" name="isDeleted">
|
<column id="98" parent="12" name="isDeleted">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="97" parent="12" name="isErased">
|
<column id="99" parent="12" name="deleteId">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
|
<DataType>TEXT|0s</DataType>
|
||||||
|
<DefaultExpression>NULL</DefaultExpression>
|
||||||
|
</column>
|
||||||
|
<column id="100" parent="12" name="isErased">
|
||||||
|
<Position>10</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="98" parent="12" name="dateCreated">
|
<column id="101" parent="12" name="dateCreated">
|
||||||
<Position>10</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="99" parent="12" name="dateModified">
|
|
||||||
<Position>11</Position>
|
<Position>11</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="100" parent="12" name="utcDateCreated">
|
<column id="102" parent="12" name="dateModified">
|
||||||
<Position>12</Position>
|
<Position>12</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="101" parent="12" name="utcDateModified">
|
<column id="103" parent="12" name="utcDateCreated">
|
||||||
<Position>13</Position>
|
<Position>13</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="102" parent="12" name="sqlite_autoindex_notes_1">
|
<column id="104" parent="12" name="utcDateModified">
|
||||||
|
<Position>14</Position>
|
||||||
|
<DataType>TEXT|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
|
</column>
|
||||||
|
<index id="105" parent="12" name="sqlite_autoindex_notes_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="103" parent="12" name="IDX_notes_title">
|
<index id="106" parent="12" name="IDX_notes_title">
|
||||||
<ColNames>title</ColNames>
|
<ColNames>title</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="104" parent="12" name="IDX_notes_type">
|
<index id="107" parent="12" name="IDX_notes_type">
|
||||||
<ColNames>type</ColNames>
|
<ColNames>type</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="105" parent="12" name="IDX_notes_isDeleted">
|
<index id="108" parent="12" name="IDX_notes_isDeleted">
|
||||||
<ColNames>isDeleted</ColNames>
|
<ColNames>isDeleted</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="106" parent="12" name="IDX_notes_dateCreated">
|
<index id="109" parent="12" name="IDX_notes_dateCreated">
|
||||||
<ColNames>dateCreated</ColNames>
|
<ColNames>dateCreated</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="107" parent="12" name="IDX_notes_dateModified">
|
<index id="110" parent="12" name="IDX_notes_dateModified">
|
||||||
<ColNames>dateModified</ColNames>
|
<ColNames>dateModified</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="108" parent="12" name="IDX_notes_utcDateCreated">
|
<index id="111" parent="12" name="IDX_notes_utcDateCreated">
|
||||||
<ColNames>utcDateCreated</ColNames>
|
<ColNames>utcDateCreated</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<index id="109" parent="12" name="IDX_notes_utcDateModified">
|
<index id="112" parent="12" name="IDX_notes_utcDateModified">
|
||||||
<ColNames>utcDateModified</ColNames>
|
<ColNames>utcDateModified</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="110" parent="12">
|
<key id="113" parent="12">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="111" parent="13" name="name">
|
<column id="114" parent="13" name="name">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="112" parent="13" name="value">
|
<column id="115" parent="13" name="value">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="113" parent="13" name="isSynced">
|
<column id="116" parent="13" name="isSynced">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="114" parent="13" name="hash">
|
<column id="117" parent="13" name="hash">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="115" parent="13" name="utcDateCreated">
|
<column id="118" parent="13" name="utcDateCreated">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="116" parent="13" name="utcDateModified">
|
<column id="119" parent="13" name="utcDateModified">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="117" parent="13" name="sqlite_autoindex_options_1">
|
<index id="120" parent="13" name="sqlite_autoindex_options_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>name</ColNames>
|
<ColNames>name</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="118" parent="13">
|
<key id="121" parent="13">
|
||||||
<ColNames>name</ColNames>
|
<ColNames>name</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="119" parent="14" name="noteId">
|
<column id="122" parent="14" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="120" parent="14" name="notePath">
|
<column id="123" parent="14" name="notePath">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="121" parent="14" name="hash">
|
<column id="124" parent="14" name="hash">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="122" parent="14" name="utcDateCreated">
|
<column id="125" parent="14" name="utcDateCreated">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="123" parent="14" name="isDeleted">
|
<column id="126" parent="14" name="isDeleted">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<index id="124" parent="14" name="sqlite_autoindex_recent_notes_1">
|
<index id="127" parent="14" name="sqlite_autoindex_recent_notes_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="125" parent="14">
|
<key id="128" parent="14">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="126" parent="15" name="sourceId">
|
<column id="129" parent="15" name="sourceId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="127" parent="15" name="utcDateCreated">
|
<column id="130" parent="15" name="utcDateCreated">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="128" parent="15" name="sqlite_autoindex_source_ids_1">
|
<index id="131" parent="15" name="sqlite_autoindex_source_ids_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>sourceId</ColNames>
|
<ColNames>sourceId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="129" parent="15" name="IDX_source_ids_utcDateCreated">
|
<index id="132" parent="15" name="IDX_source_ids_utcDateCreated">
|
||||||
<ColNames>utcDateCreated</ColNames>
|
<ColNames>utcDateCreated</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="130" parent="15">
|
<key id="133" parent="15">
|
||||||
<ColNames>sourceId</ColNames>
|
<ColNames>sourceId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="131" parent="16" name="type">
|
<column id="134" parent="16" name="type">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="132" parent="16" name="name">
|
<column id="135" parent="16" name="name">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="133" parent="16" name="tbl_name">
|
<column id="136" parent="16" name="tbl_name">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="134" parent="16" name="rootpage">
|
<column id="137" parent="16" name="rootpage">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>integer|0s</DataType>
|
<DataType>int|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="135" parent="16" name="sql">
|
<column id="138" parent="16" name="sql">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="136" parent="17" name="name">
|
<column id="139" parent="17" name="name">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
</column>
|
</column>
|
||||||
<column id="137" parent="17" name="seq">
|
<column id="140" parent="17" name="seq">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
</column>
|
</column>
|
||||||
<column id="138" parent="18" name="id">
|
<column id="141" parent="18" name="id">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<SequenceIdentity>1</SequenceIdentity>
|
<SequenceIdentity>1</SequenceIdentity>
|
||||||
</column>
|
</column>
|
||||||
<column id="139" parent="18" name="entityName">
|
<column id="142" parent="18" name="entityName">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="140" parent="18" name="entityId">
|
<column id="143" parent="18" name="entityId">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="141" parent="18" name="sourceId">
|
<column id="144" parent="18" name="sourceId">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="142" parent="18" name="utcSyncDate">
|
<column id="145" parent="18" name="utcSyncDate">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="143" parent="18" name="IDX_sync_entityName_entityId">
|
<index id="146" parent="18" name="IDX_sync_entityName_entityId">
|
||||||
<ColNames>entityName
|
<ColNames>entityName
|
||||||
entityId</ColNames>
|
entityId</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="144" parent="18" name="IDX_sync_utcSyncDate">
|
<index id="147" parent="18" name="IDX_sync_utcSyncDate">
|
||||||
<ColNames>utcSyncDate</ColNames>
|
<ColNames>utcSyncDate</ColNames>
|
||||||
|
<ColumnCollations></ColumnCollations>
|
||||||
</index>
|
</index>
|
||||||
<key id="145" parent="18">
|
<key id="148" parent="18">
|
||||||
<ColNames>id</ColNames>
|
<ColNames>id</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
</key>
|
</key>
|
||||||
|
@ -41,9 +41,26 @@ export async function showDialog() {
|
|||||||
$noteLink = $("<span>").text(change.current_title);
|
$noteLink = $("<span>").text(change.current_title);
|
||||||
|
|
||||||
if (change.canBeUndeleted) {
|
if (change.canBeUndeleted) {
|
||||||
|
const $undeleteLink = $(`<a href="javascript:">`)
|
||||||
|
.text("undelete")
|
||||||
|
.on('click', async () => {
|
||||||
|
const confirmDialog = await import('../dialogs/confirm.js');
|
||||||
|
const text = 'Do you want to undelete this note and its sub-notes?';
|
||||||
|
|
||||||
|
if (await confirmDialog.confirm(text)) {
|
||||||
|
await server.put(`notes/${change.noteId}/undelete`);
|
||||||
|
|
||||||
|
$dialog.modal('hide');
|
||||||
|
|
||||||
|
await treeCache.reloadNotes([change.noteId]);
|
||||||
|
|
||||||
|
treeService.activateNote(change.noteId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$noteLink
|
$noteLink
|
||||||
.append(' (')
|
.append(' (')
|
||||||
.append($(`<a href="">`).text("undelete"))
|
.append($undeleteLink)
|
||||||
.append(')');
|
.append(')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,6 +265,24 @@ ws.subscribeToMessages(async message => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ws.subscribeToMessages(async message => {
|
||||||
|
if (message.taskType !== 'undelete-notes') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message.type === 'task-error') {
|
||||||
|
toastService.closePersistent(message.taskId);
|
||||||
|
toastService.showError(message.message);
|
||||||
|
} else if (message.type === 'task-progress-count') {
|
||||||
|
toastService.showPersistent(makeToast(message.taskId, "Undeleting notes in progress: " + message.progressCount));
|
||||||
|
} else if (message.type === 'task-succeeded') {
|
||||||
|
const toast = makeToast(message.taskId, "Undeleting notes finished successfully.");
|
||||||
|
toast.closeAfter = 5000;
|
||||||
|
|
||||||
|
toastService.showPersistent(toast);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
moveBeforeNode,
|
moveBeforeNode,
|
||||||
moveAfterNode,
|
moveAfterNode,
|
||||||
|
@ -71,6 +71,16 @@ async function deleteNote(req) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function undeleteNote(req) {
|
||||||
|
const note = await repository.getNote(req.params.noteId);
|
||||||
|
|
||||||
|
const taskContext = TaskContext.getInstance(utils.randomString(), 'undelete-notes');
|
||||||
|
|
||||||
|
await noteService.undeleteNote(note, note.deleteId, taskContext);
|
||||||
|
|
||||||
|
await taskContext.taskSucceeded();
|
||||||
|
}
|
||||||
|
|
||||||
async function sortNotes(req) {
|
async function sortNotes(req) {
|
||||||
const noteId = req.params.noteId;
|
const noteId = req.params.noteId;
|
||||||
|
|
||||||
@ -172,6 +182,7 @@ module.exports = {
|
|||||||
getNote,
|
getNote,
|
||||||
updateNote,
|
updateNote,
|
||||||
deleteNote,
|
deleteNote,
|
||||||
|
undeleteNote,
|
||||||
createNote,
|
createNote,
|
||||||
sortNotes,
|
sortNotes,
|
||||||
protectSubtree,
|
protectSubtree,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const sql = require('../../services/sql');
|
const sql = require('../../services/sql');
|
||||||
const protectedSessionService = require('../../services/protected_session');
|
const protectedSessionService = require('../../services/protected_session');
|
||||||
|
const noteService = require('../../services/notes');
|
||||||
|
|
||||||
async function getRecentChanges() {
|
async function getRecentChanges() {
|
||||||
const recentChanges = await sql.getRows(
|
const recentChanges = await sql.getRows(
|
||||||
@ -60,17 +61,10 @@ async function getRecentChanges() {
|
|||||||
else {
|
else {
|
||||||
const deleteId = change.current_deleteId;
|
const deleteId = change.current_deleteId;
|
||||||
|
|
||||||
const undeletedParentCount = await sql.getValue(`
|
const undeletedParentBranches = await noteService.getUndeletedParentBranches(change.noteId, deleteId);
|
||||||
SELECT COUNT(parentNote.noteId)
|
|
||||||
FROM branches
|
|
||||||
JOIN notes AS parentNote ON parentNote.noteId = branches.parentNoteId
|
|
||||||
WHERE branches.noteId = ?
|
|
||||||
AND branches.isDeleted = 1
|
|
||||||
AND branches.deleteId = ?
|
|
||||||
AND parentNote.isDeleted = 0`, [change.noteId, deleteId]);
|
|
||||||
|
|
||||||
// note (and the subtree) can be undeleted if there's at least one undeleted parent (whose branch would be undeleted by this op)
|
// note (and the subtree) can be undeleted if there's at least one undeleted parent (whose branch would be undeleted by this op)
|
||||||
change.canBeUndeleted = undeletedParentCount > 0;
|
change.canBeUndeleted = undeletedParentBranches.length > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ function register(app) {
|
|||||||
apiRoute(GET, '/api/notes/:noteId', notesApiRoute.getNote);
|
apiRoute(GET, '/api/notes/:noteId', notesApiRoute.getNote);
|
||||||
apiRoute(PUT, '/api/notes/:noteId', notesApiRoute.updateNote);
|
apiRoute(PUT, '/api/notes/:noteId', notesApiRoute.updateNote);
|
||||||
apiRoute(DELETE, '/api/notes/:noteId', notesApiRoute.deleteNote);
|
apiRoute(DELETE, '/api/notes/:noteId', notesApiRoute.deleteNote);
|
||||||
|
apiRoute(PUT, '/api/notes/:noteId/undelete', notesApiRoute.undeleteNote);
|
||||||
apiRoute(POST, '/api/notes/:parentNoteId/children', notesApiRoute.createNote);
|
apiRoute(POST, '/api/notes/:parentNoteId/children', notesApiRoute.createNote);
|
||||||
apiRoute(PUT, '/api/notes/:noteId/sort', notesApiRoute.sortNotes);
|
apiRoute(PUT, '/api/notes/:noteId/sort', notesApiRoute.sortNotes);
|
||||||
apiRoute(PUT, '/api/notes/:noteId/protect/:isProtected', notesApiRoute.protectSubtree);
|
apiRoute(PUT, '/api/notes/:noteId/protect/:isProtected', notesApiRoute.protectSubtree);
|
||||||
|
@ -445,6 +445,88 @@ async function deleteBranch(branch, deleteId, taskContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Note} note
|
||||||
|
* @param {string} deleteId
|
||||||
|
* @param {TaskContext} taskContext
|
||||||
|
*/
|
||||||
|
async function undeleteNote(note, deleteId, taskContext) {
|
||||||
|
const undeletedParentBranches = await getUndeletedParentBranches(note.noteId, deleteId);
|
||||||
|
|
||||||
|
if (undeletedParentBranches.length === 0) {
|
||||||
|
// cannot undelete if there's no undeleted parent
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const parentBranch of undeletedParentBranches) {
|
||||||
|
await undeleteBranch(parentBranch, deleteId, taskContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Branch} branch
|
||||||
|
* @param {string} deleteId
|
||||||
|
* @param {TaskContext} taskContext
|
||||||
|
*/
|
||||||
|
async function undeleteBranch(branch, deleteId, taskContext) {
|
||||||
|
if (!branch.isDeleted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const note = await branch.getNote();
|
||||||
|
|
||||||
|
if (note.isDeleted && note.deleteId !== deleteId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
branch.isDeleted = false;
|
||||||
|
await branch.save();
|
||||||
|
|
||||||
|
taskContext.increaseProgressCount();
|
||||||
|
|
||||||
|
if (note.isDeleted && note.deleteId === deleteId) {
|
||||||
|
note.isDeleted = false;
|
||||||
|
await note.save();
|
||||||
|
|
||||||
|
const attrs = await repository.getEntities(`
|
||||||
|
SELECT * FROM attributes
|
||||||
|
WHERE isDeleted = 1
|
||||||
|
AND deleteId = ?
|
||||||
|
AND (noteId = ?
|
||||||
|
OR (type = 'relation' AND value = ?))`, [deleteId, note.noteId, note.noteId]);
|
||||||
|
|
||||||
|
for (const attr of attrs) {
|
||||||
|
attr.isDeleted = false;
|
||||||
|
await attr.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
const childBranches = await repository.getEntities(`
|
||||||
|
SELECT branches.*
|
||||||
|
FROM branches
|
||||||
|
WHERE branches.isDeleted = 1
|
||||||
|
AND branches.deleteId = ?
|
||||||
|
AND branches.parentNoteId = ?`, [deleteId, note.noteId]);
|
||||||
|
|
||||||
|
for (const childBranch of childBranches) {
|
||||||
|
await deleteBranch(childBranch, deleteId, taskContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return return deleted branches of an undeleted parent note
|
||||||
|
*/
|
||||||
|
async function getUndeletedParentBranches(noteId, deleteId) {
|
||||||
|
return await repository.getEntities(`
|
||||||
|
SELECT branches.*
|
||||||
|
FROM branches
|
||||||
|
JOIN notes AS parentNote ON parentNote.noteId = branches.parentNoteId
|
||||||
|
WHERE branches.noteId = ?
|
||||||
|
AND branches.isDeleted = 1
|
||||||
|
AND branches.deleteId = ?
|
||||||
|
AND parentNote.isDeleted = 0`, [noteId, deleteId]);
|
||||||
|
}
|
||||||
|
|
||||||
async function scanForLinks(noteId) {
|
async function scanForLinks(noteId) {
|
||||||
const note = await repository.getNote(noteId);
|
const note = await repository.getNote(noteId);
|
||||||
if (!note || !['text', 'relation-map'].includes(note.type)) {
|
if (!note || !['text', 'relation-map'].includes(note.type)) {
|
||||||
@ -552,7 +634,9 @@ module.exports = {
|
|||||||
createNewNoteWithTarget,
|
createNewNoteWithTarget,
|
||||||
updateNote,
|
updateNote,
|
||||||
deleteBranch,
|
deleteBranch,
|
||||||
|
undeleteNote,
|
||||||
protectNoteRecursively,
|
protectNoteRecursively,
|
||||||
scanForLinks,
|
scanForLinks,
|
||||||
duplicateNote
|
duplicateNote,
|
||||||
|
getUndeletedParentBranches
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user