File: migrate-oracle-schema-to-2-1-0.sql

package info (click to toggle)
dpm-postgres 1.7.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,788 kB
  • ctags: 10,782
  • sloc: ansic: 146,136; sh: 13,362; perl: 11,142; python: 5,529; cpp: 5,113; sql: 1,790; makefile: 955; fortran: 113
file content (27 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--
-- Scripts that migrates the Database Schema from 1.1.1 to 2.0.0
--
-- The 2.1.0 schema for Oracle replace the virtual ids sequences by tables.
--

--
-- Create the new tables
--
CREATE TABLE Cns_unique_uid (
       id NUMBER(10));
INSERT INTO Cns_unique_uid SELECT Cns_uid_seq.NEXTVAL FROM DUAL;

CREATE TABLE Cns_unique_gid (
       id NUMBER(10));
INSERT INTO Cns_unique_gid SELECT Cns_gid_seq.NEXTVAL FROM DUAL;

--
-- Delete the sequences
--
DROP SEQUENCE Cns_uid_seq;
DROP SEQUENCE Cns_gid_seq;

--
-- Update the schema version
--
UPDATE schema_version SET major=2, minor=1, patch=0;