Skip to content

Instantly share code, notes, and snippets.

@lrealdi
Created February 28, 2019 20:37
Show Gist options
  • Select an option

  • Save lrealdi/a4c05f100d2a0250e3194954aa04ea1b to your computer and use it in GitHub Desktop.

Select an option

Save lrealdi/a4c05f100d2a0250e3194954aa04ea1b to your computer and use it in GitHub Desktop.
select * from ezcontentobject_version where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
delete from ezcontentobject_version where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass))
select count(*) from ezcontentobject_attribute where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
delete from ezcontentobject_attribute where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
select count(*) from ezcontentobject_name where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
delete from ezcontentobject_name where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
select count(*) from ezcontentobject_tree where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
delete from ezcontentobject_tree where contentobject_id in (select id from ezcontentobject where contentclass_id not in (select id from ezcontentclass));
select count(*) from ezcontentobject where contentclass_id not in (select id from ezcontentclass);
delete from ezcontentobject where contentclass_id not in (select id from ezcontentclass);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment