use PL/PerlU rather than PL/Perl
[migration-tools.git] / sql / nuke-bibs-and-items.sql
1 -- Copyright 2009-2012, Equinox Software, Inc.
2 --
3 -- This program is free software; you can redistribute it and/or
4 -- modify it under the terms of the GNU General Public License
5 -- as published by the Free Software Foundation; either version 2
6 -- of the License, or (at your option) any later version.
7 --
8 -- This program is distributed in the hope that it will be useful,
9 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
10 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 -- GNU General Public License for more details.
12 --
13 -- You should have received a copy of the GNU General Public License
14 -- along with this program; if not, write to the Free Software
15 -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17 BEGIN;
18
19 DROP TABLE IF EXISTS asset.call_number_temp;
20 CREATE TABLE asset.call_number_temp AS (
21   SELECT * FROM asset.call_number WHERE id = -1
22 );
23
24 DROP TABLE IF EXISTS biblio.record_entry_temp;
25 CREATE TABLE biblio.record_entry_temp AS (
26   SELECT * FROM biblio.record_entry WHERE id = -1
27 );
28
29
30 TRUNCATE
31   action.circulation,
32   asset.copy,
33   biblio.record_entry,
34   asset.call_number,
35   metabib.metarecord_source_map,
36   metabib.metarecord
37 CASCADE;
38
39 INSERT INTO asset.call_number SELECT * FROM asset.call_number_temp;
40 INSERT INTO biblio.record_entry SELECT * FROM biblio.record_entry_temp;
41
42