From 9f25d84accb5a3657cb4c7dd87014d9f13ccf2ef Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@robocracy.org>
Date: Thu, 13 Sep 2018 00:23:09 -0700
Subject: improve dump scripts

---
 extra/sql_dumps/dump_release_extid.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 extra/sql_dumps/dump_release_extid.sql

(limited to 'extra/sql_dumps/dump_release_extid.sql')

diff --git a/extra/sql_dumps/dump_release_extid.sql b/extra/sql_dumps/dump_release_extid.sql
new file mode 100644
index 00000000..5e93cb1d
--- /dev/null
+++ b/extra/sql_dumps/dump_release_extid.sql
@@ -0,0 +1,12 @@
+
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
+COPY (SELECT release_ident.id, release_rev.id, release_rev.doi, release_rev.pmcid, release_rev.pmid,
+             release_rev.core_id, release_rev.wikidata_qid
+      FROM release_rev
+      INNER JOIN release_ident ON release_ident.rev_id = release_rev.id
+      WHERE release_ident.is_live = 't' AND release_ident.redirect_id IS NULL)
+    TO STDOUT
+    WITH NULL '';
+
+ROLLBACK;
-- 
cgit v1.2.3

