Comments (3)
select ns_id, document_id, node_type_field_id, count(*) as cnt
from nodes_sources_documents
group by ns_id, document_id, node_type_field_id
having count(*) > 1;
select node_a_id, node_b_id, node_type_field_id, count(*) as cnt
from nodes_to_nodes
group by node_a_id, node_b_id, node_type_field_id
having count(*) > 1;
from roadiz.
Here is the magic SQL query to remove duplicated, always perform a SQL backup before:
delete from nodes_sources_documents
where id not in (
select t.id from (
select max(id) as id from nodes_sources_documents group by ns_id, document_id, node_type_field_id
) as t
);
- https://www.sqlshack.com/different-ways-to-sql-delete-duplicate-rows-from-a-sql-table/
- https://stackoverflow.com/questions/4429319/you-cant-specify-target-table-for-update-in-from-clause
from roadiz.
Need to fix https://github.com/roadiz/entity-generator for v1.6+
from roadiz.
Related Issues (20)
- Tag and Folder tree bug when user is chrooted
- Notice: file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory
- Feature request: filter documents explorer by mime-type
- Feature request: add CodeMirror rulers for JSON and YAML types HOT 2
- [develop] Random error after cache clear on document explorer API
- Add a NON-BREAKING-HYPHEN icon under Markdown field (as existing NON-BREAKING-SPACE)
- Add semaphor lock to ensure only one user can edit a node/node-source/tag/document HOT 1
- Add a SocketIO connector to broadcast messages when a content is edited from backoffice
- Non-reachable nodes' names should be prefixed or suffixed by their type HOT 1
- OpenID: User impersonation prevents admin user to go back to its account if it is connected using OpenID HOT 1
- Distinguer le nom des noeuds dans la recherche HOT 2
- Keyboard shortcuts during Node edition
- Provide SVG size attributes
- [Messenger] Migrate all Solr subscribers to Messenging for performance HOT 1
- [Documents] Add a new view and filter to list documents by filesize HOT 1
- splashbase.co API is dead 😢
- Webhooks: scope automatic triggers to a root node
- collapsed.uk.nestable local storage value is used before ready
- Fresh install : error 500 Identifier "Themes\FooBarTheme\TreeWalker\NodeSourceWalkerContext" is not defined. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadiz.