REM
REM This ORACLE7/8 command file was generated by Oracle Server Generator
REM Version 5.5.10.0.0 on 05-APR-99
REM
REM For application IMP version 1 database
REM

SPOOL IMP.lst
 
REM TABLE CREATION 
REM
REM TABLE
REM      IMP_ADDR
REM      IMP_PREF

REM
PROMPT 
PROMPT Creating Table IMP_ADDR 
CREATE TABLE imp_addr(
 username                        VARCHAR2(255)              NOT NULL,
 address                         VARCHAR2(255)              NOT NULL,
 nickname                        VARCHAR2(255)              NULL,
 fullname                        VARCHAR2(255)              NULL
)
;

REM
PROMPT 
PROMPT Creating Table IMP_PREF 
CREATE TABLE imp_pref(
 username                        VARCHAR2(255)              NOT NULL,
 sig                             VARCHAR2(2000)             NULL,
 fullname                        VARCHAR2(70)               NULL,
 replyto                         VARCHAR2(70)               NULL,
 lang                            VARCHAR2(30)               NULL
)
;

REM CONSTRAINT CREATION 
REM
REM For application IMP version 1 database
REM
REM CONSTRAINT

PROMPT Adding PRIMARY Constraint To IMP_ADDR Table

ALTER TABLE IMP_ADDR ADD (
      CONSTRAINT PK_IMP_ADDR
      PRIMARY KEY (USERNAME,
                   ADDRESS)
)
/

PROMPT Adding PRIMARY Constraint To IMP_PREF Table

ALTER TABLE IMP_PREF ADD (
      CONSTRAINT PK_IMP_PREF
      PRIMARY KEY (USERNAME)
)
/

PROMPT Adding FOREIGN Constraint To IMP_ADDR Table

ALTER TABLE IMP_ADDR ADD (
      CONSTRAINT FK_PREF_ADDR
      FOREIGN KEY (USERNAME)
      REFERENCES  IMP_PREF (
                   USERNAME)
)
/

REM
REM  End of command file
REM
SPOOL OFF
