Argow
Solution ready!
:
:
:
Script de Criação dos Metadados
A especificação atual dos
Metadados
é 1.9 disponível em
XML
, o
diagrama
e o script SQL abaixo:
-- ====================================================================================== -- ARGOW -- Criador das Tabelas e Relacoes dos Metadados do Argow -- Permissao: Administrador -- Criado 2003.07 -- Ultima atualizacao: 2010.11.11 mgd -- Versao 2.1 -- ====================================================================================== Begin Transaction --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== -- DIC --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICAPPMENU ( PK int IDENTITY (1, 1) NOT NULL , APPLICATION varchar (64) NOT NULL , TABLENAME varchar (64) NULL , SCRIPTNAME varchar (64) NULL , MENU varchar (254) NOT NULL , ITEMID varchar(6) NULL, MENUORDER int NULL, QUICKACCESSORDER int NULL, TABLEFILTER varchar (1024) NULL , ITEMACTION varchar (254) NULL , CAPTION varchar (64) NULL , HELPCONTEXT varchar (32) NULL, HINT varchar (128) NULL , MENUNAME varchar (64) NULL, RESOURCENAME varchar(64) NULL ) ALTER TABLE DICAPPMENU ADD CONSTRAINT PK_DICAPPMENU PRIMARY KEY NONCLUSTERED (PK) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICCONFIG ( PK int IDENTITY (1, 1) NOT NULL , APPLICATION varchar (64) NOT NULL , VARNAME varchar (64) NULL , VARVALUE varchar (1024) NULL , DESCRIPTION varchar (128) NULL ) ALTER TABLE DICCONFIG WITH NOCHECK ADD CONSTRAINT PK_DICCONFIG PRIMARY KEY CLUSTERED (PK), CONSTRAINT IX_DICCONFIG UNIQUE NONCLUSTERED (APPLICATION, VARNAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICAPPTREE ( PK int IDENTITY (1, 1) NOT NULL , APPLICATION varchar (64) NOT NULL , TREENAME varchar (64) NOT NULL , TREEPARENT int NULL , TREEORDER int NULL , TABLENAME varchar (64) NOT NULL , TABLEALIAS varchar (64) NULL , DISPLAYINFO varchar (64) NOT NULL , KEYFIELDS varchar (64) NOT NULL , KEYFIELDSPARENT varchar (64) NULL , TABLEFILTER varchar (1024) NULL , ITEMACTION varchar (254) NULL , DISABLED varchar (1) NULL ) ALTER TABLE DICAPPTREE WITH NOCHECK ADD CONSTRAINT PK_DICAPPTREE PRIMARY KEY CLUSTERED (PK) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICJOINTYPE ( PK int IDENTITY (1, 1) NOT NULL , JOINTYPE varchar (32) NOT NULL ) ALTER TABLE DICJOINTYPE WITH NOCHECK ADD CONSTRAINT PK_DICJOINTYPE PRIMARY KEY CLUSTERED (PK), CONSTRAINT IX_DICJOINTYPE UNIQUE NONCLUSTERED (JOINTYPE) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICTABLE ( PK int IDENTITY (1, 1) NOT NULL , TABLENAME varchar (64) NOT NULL , TABLEALIAS varchar (64) NOT NULL , PRIMARYKEY varchar (64) NULL , LOADALLRECORDS char (1) NULL , [READONLY] [char] (1) NULL , [PROTECTED] [char](1) NULL, [AUXILIARY] [char](1) NULL, [VIRTUAL] [char](1) NULL, TABLEFILTER varchar (1024) NULL , ITEMACTION varchar (254) NULL , VIEWS varchar (64) NULL , HELPCONTEXT varchar (32) NULL, [DESCRIPTION] varchar (128) NULL ) ALTER TABLE DICTABLE WITH NOCHECK ADD CONSTRAINT PK_DICTABLE PRIMARY KEY NONCLUSTERED (PK), CONSTRAINT IX_DICTABLE UNIQUE NONCLUSTERED (TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICDATATYPE ( PK int IDENTITY (1, 1) NOT NULL , DATATYPE varchar (64) NOT NULL , BASICDATATYPE varchar (64) NOT NULL , -- Shared with DICFIELD [READONLY] char (1) NULL , [REQUIRED] char (1) NULL , MODIFIABLE char (1) NULL DEFAULT ('T'), CANDIDATE char (1) NULL , CALCULATED char (1) NULL , CUSTOMCONSTRAINT varchar (254) NULL , CONSTRAINTERRORMESSAGE varchar (254) NULL , EDITMASK varchar (64) NULL , DISPLAYMASK varchar (64) NULL , DEFAULTVALUE varchar (254) NULL, HINT varchar (128) NULL , HELPCONTEXT varchar (32) NULL , DESCRIPTION varchar (128) NULL, DATAEDITOR varchar (254) NULL , FORMULA varchar (2048) NULL , ) ALTER TABLE DICDATATYPE WITH NOCHECK ADD CONSTRAINT PK_DICDATATYPE PRIMARY KEY NONCLUSTERED (PK), CONSTRAINT IX_DICDATATYPE UNIQUE NONCLUSTERED (DATATYPE) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICFIELD ( PK int IDENTITY (1, 1) NOT NULL , TABLENAME varchar (64) NOT NULL , FIELDNAME varchar (64) NOT NULL , FIELDALIAS varchar (64) NULL , DATATYPE varchar (64) NOT NULL , HIDE char (1) NULL , -- Shared with DICDATATYPE [READONLY] char (1) NULL , [REQUIRED] char (1) NULL , MODIFIABLE char (1) NULL DEFAULT ('T'), CANDIDATE char (1) NULL , CALCULATED char (1) NULL , CUSTOMCONSTRAINT varchar (254) NULL , CONSTRAINTERRORMESSAGE varchar (254) NULL , EDITMASK varchar (64) NULL , DISPLAYMASK varchar (64) NULL , DEFAULTVALUE varchar (254) NULL, HINT varchar (128) NULL , HELPCONTEXT varchar (32) NULL , DESCRIPTION varchar (128) NULL, DATAEDITOR varchar (254) NULL , FORMULA varchar (2048) NULL , -- Report Builder SELECTABLE char (1) NULL DEFAULT ('T') , SEARCHABLE char (1) NULL DEFAULT ('T') , SORTABLE char (1) NULL DEFAULT ('T') , AUTOSEARCH char (1) NULL DEFAULT ('T') , MANDATORY char (1) NULL ) ALTER TABLE DICFIELD WITH NOCHECK ADD CONSTRAINT PK_DICFIELD PRIMARY KEY NONCLUSTERED (PK), CONSTRAINT IX_DICFIELD UNIQUE NONCLUSTERED (TABLENAME, FIELDNAME) ALTER TABLE DICFIELD ADD CONSTRAINT FK_DICFIELD_DICDATATYPE FOREIGN KEY (DATATYPE) REFERENCES DICDATATYPE (DATATYPE), CONSTRAINT FK_DICFIELD_DICTABLE FOREIGN KEY (TABLENAME) REFERENCES DICTABLE (TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICJOIN ( PK int IDENTITY (1, 1) NOT NULL , TABLEMASTER varchar (64) NOT NULL , TABLEDETAIL varchar (64) NOT NULL , FIELDSMASTER varchar (254) NOT NULL , FIELDSDETAIL varchar (254) NOT NULL , ISLOOKUP char (1) NOT NULL , RESULTFIELDS varchar (254) NULL , RESULTALIAS varchar (254) NULL , TABORDER int NULL, ITEMACTION varchar (254) NULL , LOADFIELDS varchar (254) NULL , LOADALIAS varchar (254) NULL , LOADNAMES varchar (254) NULL , TABLEFILTER varchar (1024) NULL , RESULTNAME varchar (254) NULL , -- Report Builder JOINTYPE varchar (32) NOT NULL , OPERATORS varchar (32) NULL , ) ALTER TABLE DICJOIN WITH NOCHECK ADD CONSTRAINT PK_DICJOIN PRIMARY KEY NONCLUSTERED (PK) ALTER TABLE DICJOIN ADD CONSTRAINT FK_DICJOIN_DICJOINTYPE FOREIGN KEY (JOINTYPE) REFERENCES DICJOINTYPE ( JOINTYPE ), CONSTRAINT FK_DICJOIN_DICTABLEMASTER FOREIGN KEY (TABLEMASTER) REFERENCES DICTABLE (TABLENAME), CONSTRAINT FK_DICJOIN_DICTABLEDETAIL FOREIGN KEY (TABLEDETAIL) REFERENCES DICTABLE (TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICRESOURCE ( PK int IDENTITY (1, 1) NOT NULL , RESOURCENAME varchar (64) NOT NULL , STYLE varchar (32) NULL , RESOURCEDATA image NULL , -- MS-SQL Image TRANSPARENTCOLOR varchar (32) NULL ) ALTER TABLE DICRESOURCE WITH NOCHECK ADD CONSTRAINT PK_DICRESOURCE PRIMARY KEY NONCLUSTERED (PK), CONSTRAINT IX_DICRESOURCE UNIQUE NONCLUSTERED (STYLE,RESOURCENAME ) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICSCRIPT ( PK int IDENTITY (1, 1) NOT NULL , SCRIPTNAME varchar (64) NOT NULL , SCRIPTALIAS varchar (64) NOT NULL , SCRIPTBODY varchar (2048) NULL , [DESCRIPTION] varchar (128) NULL , RESOURCENAME varchar (64) NULL ) ALTER TABLE DICSCRIPT WITH NOCHECK ADD CONSTRAINT PK_DICSCRIPT PRIMARY KEY NONCLUSTERED (PK), CONSTRAINT IX_DICSCRIPT UNIQUE NONCLUSTERED (SCRIPTNAME) ALTER TABLE DICAPPMENU ADD CONSTRAINT FK_DICAPPMENU_DICTABLE FOREIGN KEY (TABLENAME) REFERENCES DICTABLE (TABLENAME) ALTER TABLE DICAPPTREE ADD CONSTRAINT FK_DICAPPTREE_DICTABLE FOREIGN KEY (TABLENAME) REFERENCES DICTABLE(TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== ---- AR Access & Security --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARAUSER ( [USER_ID] int IDENTITY (1, 1) NOT NULL , [USER_NAME] varchar (32) NOT NULL , USER_REAL_NAME varchar (64) NULL , PROF_ID int NULL , USER_PWD varchar (128) NULL , USER_EMAIL varchar (128) NULL , LAST_PWD_CHANGE datetime NULL , MUST_CHANGE_PWD char (1) NULL DEFAULT ('F'), AUDIT_MODE char (1) NULL DEFAULT ('F') ) ALTER TABLE ARAUSER WITH NOCHECK ADD CONSTRAINT PK_ARAUSER PRIMARY KEY CLUSTERED (USER_ID), CONSTRAINT IX_ARAUSER UNIQUE NONCLUSTERED (USER_NAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARAPROFILE ( PROF_ID int IDENTITY (1, 1) NOT NULL , PROF_NAME varchar (64) NOT NULL , INTERVAL_CHANGE_PWD int NULL , MUST_CHANGE_PWD_FROM datetime NULL, AUDIT_MODE char (1) NULL DEFAULT ('F') ) ALTER TABLE ARAPROFILE WITH NOCHECK ADD CONSTRAINT PK_ARAPROFILE PRIMARY KEY CLUSTERED (PROF_ID), CONSTRAINT IX_ARAPROFILE UNIQUE NONCLUSTERED (PROF_NAME) ALTER TABLE ARAUSER ADD CONSTRAINT FK_ARAUSER_ARAPROFILE FOREIGN KEY (PROF_ID) REFERENCES ARAPROFILE (PROF_ID) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARAFIELDACCESS ( PK int IDENTITY (1, 1) NOT NULL , [USER_ID] int NULL , PROF_ID int NULL , TABLENAME varchar (64) NOT NULL , FIELDNAME varchar (64) NOT NULL , AC_VIEW char (1) NULL DEFAULT ('F'), AC_EDIT char (1) NULL DEFAULT ('F') ) ALTER TABLE ARAFIELDACCESS WITH NOCHECK ADD CONSTRAINT PK_ARAFIELDACCESS PRIMARY KEY CLUSTERED (PK), CONSTRAINT FK_ARAFIELDACCESS_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID), CONSTRAINT FK_ARAFIELDACCESS_ARAPROFILE FOREIGN KEY (PROF_ID) REFERENCES ARAPROFILE (PROF_ID), CONSTRAINT FK_ARAFIELDACCESS_DICFIELD FOREIGN KEY (TABLENAME, FIELDNAME) REFERENCES DICFIELD (TABLENAME, FIELDNAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARATABLEACCESS ( PK int IDENTITY (1, 1) NOT NULL , TABLENAME varchar (64) NOT NULL , [USER_ID] int NULL , PROF_ID int NULL , LOG_TABLE char (1) NULL, AC_VIEW char (1) NULL, AC_PRINT char (1) NULL, AC_SCRIPT char (1) NULL, AC_DELETE char (1) NULL, AC_INSERT char (1) NULL, AC_EDIT char (1) NULL ) ALTER TABLE ARATABLEACCESS WITH NOCHECK ADD CONSTRAINT PK_ARATABLEACCESS PRIMARY KEY CLUSTERED (PK), CONSTRAINT FK_ARATABLEACCESS_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID), CONSTRAINT FK_ARATABLEACCESS_ARAPROFILE FOREIGN KEY (PROF_ID) REFERENCES ARAPROFILE (PROF_ID), CONSTRAINT FK_ARATABLEACCESS_DICTABLE FOREIGN KEY (TABLENAME) REFERENCES DICTABLE (TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARATABLEDEFAULTACCESS ( PK int IDENTITY (1, 1) NOT NULL , [APPLICATION] varchar (64) NOT NULL , TABLENAME varchar (64) NOT NULL , TABLEFILTER varchar (1024) NULL , ITEMACTION varchar (254) NULL , LOG_TABLE char (1) NULL DEFAULT ('F'), AC_VIEW char (1) NULL DEFAULT ('T'), AC_PRINT char (1) NULL DEFAULT ('T'), AC_SCRIPT char (1) NULL DEFAULT ('T'), AC_DELETE char (1) NULL DEFAULT ('T'), AC_INSERT char (1) NULL DEFAULT ('T'), AC_EDIT char (1) NULL DEFAULT ('T') ) ALTER TABLE ARATABLEDEFAULTACCESS WITH NOCHECK ADD CONSTRAINT PK_ARATABLEDEFAULTACCESS PRIMARY KEY CLUSTERED (PK), CONSTRAINT IX_ARATABLEDEFAULTACCESS UNIQUE NONCLUSTERED ( APPLICATION, TABLENAME), CONSTRAINT FK_ARATABLEDEFAULTACCESS_DICTABLE FOREIGN KEY (TABLENAME) REFERENCES DICTABLE (TABLENAME) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARALOG ( PK int IDENTITY (1, 1) NOT NULL , [USER_ID] int NOT NULL , LOG_TABLE varchar (64) NULL , LOG_WHEN datetime NULL , LOG_EVENT char (1) NULL , LOG_KEY varchar (64) NULL , LOG_DATA char (1024) NULL , LOG_TEXT text NULL ) ALTER TABLE ARALOG WITH NOCHECK ADD CONSTRAINT PK_ARALOG PRIMARY KEY CLUSTERED (PK), CONSTRAINT FK_ARALOG_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARAMENUACCESS ( PK int IDENTITY (1, 1) NOT NULL , [USER_ID] int NULL , PROF_ID int NULL , MENUNAME varchar (64) NOT NULL , [ENABLED] char (1) NULL DEFAULT ('T') ) ALTER TABLE ARAMENUACCESS WITH NOCHECK ADD CONSTRAINT PK_ARAMENUACCESS PRIMARY KEY CLUSTERED (PK), CONSTRAINT FK_ARAMENUACCESS_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID), CONSTRAINT FK_ARAMENUACCESS_ARAPROFILE FOREIGN KEY (PROF_ID) REFERENCES ARAPROFILE (PROF_ID) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE ARAUSERINFO ( PK int IDENTITY (1, 1) NOT NULL , [APPLICATION] varchar (64) NOT NULL , [USER_ID] int NOT NULL , EXPIRATION_DATE datetime NULL , USER_DISABLED char (1) NULL DEFAULT ('F'), USER_LOGGED char (1) NULL DEFAULT ('F'), USER_LOGGED_PC varchar (64) NULL , USER_LOGGED_DATE datetime NULL , USER_IS_POWER char (1) NULL DEFAULT ('F'), USER_CONFIG text NULL , INTERVAL_CHANGE_PWD int NULL, ITEMACTION varchar (254) NULL ) ALTER TABLE ARAUSERINFO WITH NOCHECK ADD CONSTRAINT PK_ARAUSERINFO PRIMARY KEY CLUSTERED (PK), CONSTRAINT IX_ARAUSERINFO UNIQUE NONCLUSTERED (APPLICATION, USER_ID), CONSTRAINT FK_ARAUSERINFO_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID) GO --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== -- Report Builder --==--==--==---==--==--==--==--==--==---==--==--==--==--==--==---==--==--==--== CREATE TABLE DICRBFOLDER ( FOLDERID int IDENTITY (1, 1) NOT NULL , FOLDERNAME varchar (64) NOT NULL , PARENTID int NOT NULL ) ALTER TABLE DICRBFOLDER WITH NOCHECK ADD CONSTRAINT PK_DICRBFOLDER PRIMARY KEY NONCLUSTERED (FOLDERID), CONSTRAINT IX_DICRBFOLDER UNIQUE NONCLUSTERED (FOLDERNAME, PARENTID) GO CREATE TABLE DICRBITEM ( ITEMID int IDENTITY (1, 1) NOT NULL , FOLDERID int NOT NULL , ITEMNAME varchar (64) NOT NULL , ITEMSIZE int NULL , ITEMTYPE int NOT NULL , MODIFIED datetime NULL , DELETED datetime NULL , TEMPLATE text NULL , APPLICATIONS varchar (254) NULL , ONMENU char(1) NULL, RESOURCENAME varchar (64) NULL, PROF_ID int NULL, [USER_ID] int NULL, ITEMACTION varchar (254) NULL ) ALTER TABLE DICRBITEM WITH NOCHECK ADD CONSTRAINT PK_DICRBITEM PRIMARY KEY NONCLUSTERED (ITEMID), CONSTRAINT FK_DICRBITEM_ARAUSER FOREIGN KEY (USER_ID) REFERENCES ARAUSER (USER_ID), CONSTRAINT FK_DICRBITEM_ARAPROFILE FOREIGN KEY (PROF_ID) REFERENCES ARAPROFILE (PROF_ID) GO Commit --Rollback Transaction
© 2008−2011
Argow