mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
delete unreferenced tags on update
This commit is contained in:
parent
c7022fd37d
commit
80464ab4a5
1 changed files with 3 additions and 0 deletions
|
@ -1542,6 +1542,9 @@ facts.modelId = :id""", id=modelId))
|
||||||
insert into cardTags
|
insert into cardTags
|
||||||
(cardId, tagId, src) values
|
(cardId, tagId, src) values
|
||||||
(:cardId, :tagId, :src)""", d)
|
(:cardId, :tagId, :src)""", d)
|
||||||
|
self.s.statement("""
|
||||||
|
delete from tags where id not in (select distinct tagId from cardTags)
|
||||||
|
""")
|
||||||
|
|
||||||
def updateTagsForModel(self, model):
|
def updateTagsForModel(self, model):
|
||||||
cardIds = self.s.column0("""
|
cardIds = self.s.column0("""
|
||||||
|
|
Loading…
Reference in a new issue