Class Rubernate::DBI::OracleInit
In: rubernate/init/init_oracle.rb
Parent: GenericInit

Methods

init_db  

Constants

CREATE_R_OBJECTS = %q{ CREATE TABLE R_OBJECTS ( OBJECT_PK NUMBER(20) PRIMARY KEY, OBJECT_CLASS VARCHAR2(100) NOT NULL) }.gsub(INDENT, '')
CREATE_R_PARAMS = %q{ CREATE TABLE R_PARAMS ( OBJECT_PK NUMBER(20) NOT NULL, NAME VARCHAR2(100) NOT NULL, FLAGS NUMBER(5) NOT NULL, INT_VALUE NUMBER(20), FLT_VALUE FLOAT, STR_VALUE VARCHAR2(1000), DAT_VALUE DATE, REF_VALUE NUMBER(20), CONSTRAINT R_PARAM_FK FOREIGN KEY (OBJECT_PK) REFERENCES R_OBJECTS(OBJECT_PK) ON DELETE CASCADE, CONSTRAINT R_REF_FK FOREIGN KEY (REF_VALUE) REFERENCES R_OBJECTS(OBJECT_PK) ON DELETE CASCADE) }.gsub(INDENT, '')
CREATE_INDEX_O_PK_CLASS = %q{ CREATE INDEX R_O_PK_CLASS ON R_OBJECTS (OBJECT_PK, OBJECT_CLASS) }.gsub(INDENT, '')
CREATE_INDEX_P_PK_NAME = %q{ CREATE INDEX R_P_PK_NAME ON R_PARAMS (OBJECT_PK, NAME) }.gsub(INDENT, '')
CREATE_R_PK_SEQUENCE = %q{ CREATE SEQUENCE R_PK_SEQUENCE START WITH 1001 INCREMENT BY 1 }.gsub(INDENT, '')
TEMPLATE = %q{ /** * Creates Rubernate tables for Oracle database. * Copyright (C) 2006 Andrey Ryabov <andrey_ryabov@bk.ru> */ /** * Create r_objects table */ <%= CREATE_R_OBJECTS %>/ /** * Create r_params table */ <%= CREATE_R_PARAMS %>/ /** * Create index on r_objects */ <%= CREATE_INDEX_O_PK_CLASS %>/ /** * Create index on r_params */ <%= CREATE_INDEX_P_PK_NAME %>/ /** * Create primary key sequence */ <%= CREATE_R_PK_SEQUENCE %>/ /** * End */ }.gsub(INDENT, '')

Public Instance methods

Prints initialization script and tryes to initialize databaes database if dbh is given.

[Validate]