rem 
rem $Id: vgbild.sql,v 1.1 1998/01/02 23:35:57 bgutierr Exp $
rem 
Rem  Copyright (c) 1992 by Oracle Corporation 
Rem    NAME
Rem      vgbld.sql - <one-line expansion of the name>
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem    RETURNS
Rem 
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem    MODIFIED   (MM/DD/YY)
Rem     fpun       05/14/93 -  delete cellid from index ivg_color 
Rem     ewong      03/30/93 -  Removed exit statement 
Rem     fpun       12/04/92 -  add exit; 
Rem     fpun       12/02/92 -  Creation 
Rem     fpun       11/24/92 -  Creation 
Rem     ewong      07/17/92 -  Add column to index 
Rem     dlai       06/02/92 -  revise 
Rem     dlai       06/02/92 -  revise 
Rem     dlai       05/26/92 -  revise 
Rem     dlai       05/26/92 -  revise 
Rem     dlai       05/21/92 -  revise 
Rem     rquach     02/24/92 -  add view to VG tables. Remove tool__module.
Rem     ewong      02/04/92 -  Creation 



/*--------------------------*/
/* Define vgs drawing table */
/*--------------------------*/

create table vg__drawing (
  owner    varchar(30),       /* owner ID                          */
  modid    integer,            /* module ID                         */
  itemid   integer,            /* instance ID                       */
  longid   integer             /* long field ID                     */
);

create index ivg_drawing on vg__drawing 
(
  owner, modid, itemid
);

create view vg_drawing as
   select * from vg__drawing
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym vg_drawing for system.vg_drawing;

/*------------------------*/
/* Define vgs color table */
/*------------------------*/

create table vg__color (
  owner       varchar(30),     /* owner ID                          */
  modid       integer,         /* module ID                         */
  itemid      integer,         /* instance ID                       */
  cellid      integer,         /* color cell ID                     */
  color_name  raw(255),        /* color name                        */
  name_set    integer,         /* character set of color name       */
  name_length integer,         /* length off color name             */
  red         integer,         /* red component                     */
  green       integer,         /* green component                   */
  blue        integer          /* blue component                    */
);

create index ivg_color on vg__color 
(
  owner, modid, itemid
);

create view vg_color as
   select * from vg__color
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym vg_color for system.vg_color;

/*-------------------*/
/* Define font table */
/*-------------------*/

create table vg__font (
  owner       varchar(30),
  modid       integer,
  itemid      integer,
  fontid      integer,
  count       integer,
  name        raw(255),
  name_set    integer,
  name_len    integer,
  font_size   integer,
  style       integer,
  weight      integer,
  width       integer,
  imagetext   integer,
  kerning     integer,
  char_set    integer
);

create index ivg_font on vg__font 
(
  owner, modid, itemid, fontid
);

create view vg_font as
   select * from vg__font
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym vg_font for system.vg_font;

/*--------------------*/
/* Define image table */
/*--------------------*/

create table vg__image (
  owner    varchar(30),
  modid    integer,
  itemid   integer,
  imageid  integer,
  count    integer,
  longid   integer
);

create index ivg_image on vg__image
(
  owner, modid, itemid, imageid
);

create view vg_image as
   select * from vg__image
   where owner = user or modid in (select modid from tool_accessible)
   with check option;

create public synonym vg_image for system.vg_image;

