-- MS-SQL Server DDL File
-- GOMA DDL Generator Version: 2.5, Build: 184 (SchemaGen2 V. 1.0, Build: 184)

-- begin cleanup script part
-- begin table cleanup script part
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Node]'))
	DROP TABLE Node
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[eBissUser]'))
	DROP TABLE eBissUser
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AccessRight]'))
	DROP TABLE AccessRight
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[JobDef]'))
	DROP TABLE JobDef
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[RuntimeSession]'))
	DROP TABLE RuntimeSession
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AddressBase]'))
	DROP TABLE AddressBase
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[TypeSet_AddressBase]'))
	DROP TABLE TypeSet_AddressBase
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[MessageBox]'))
	DROP TABLE MessageBox
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Message]'))
	DROP TABLE Message
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ProcessInstance_Message]'))
	DROP TABLE ProcessInstance_Message
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Attachment]'))
	DROP TABLE Attachment
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Interchange]'))
	DROP TABLE Interchange
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Document]'))
	DROP TABLE Document
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[MapDef]'))
	DROP TABLE MapDef
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LookupTableType]'))
	DROP TABLE LookupTableType
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LookupTable]'))
	DROP TABLE LookupTable
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LookupTableEntry]'))
	DROP TABLE LookupTableEntry
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LookupTableValueProvider]'))
	DROP TABLE LookupTableValueProvider
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LookupTableValueProviderEntry]'))
	DROP TABLE LookupTableValueProviderEntry
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Partner]'))
	DROP TABLE Partner
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Article]'))
	DROP TABLE Article
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleDetail]'))
	DROP TABLE ArticleDetail
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[DocMatch]'))
	DROP TABLE DocMatch
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleSubscription]'))
	DROP TABLE ArticleSubscription
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Task]'))
	DROP TABLE Task
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Task_ObjectReference]'))
	DROP TABLE Task_ObjectReference
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ProcessInstance]'))
	DROP TABLE ProcessInstance
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ObjectReference]'))
	DROP TABLE ObjectReference
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ScheduleEvent]'))
	DROP TABLE ScheduleEvent
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ScheduleTime]'))
	DROP TABLE ScheduleTime
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[PortEventListener]'))
	DROP TABLE PortEventListener
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CoreEventListener]'))
	DROP TABLE CoreEventListener
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[PortAccessRule]'))
	DROP TABLE PortAccessRule
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CoreChannel]'))
	DROP TABLE CoreChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[HttpReceiveChannel]'))
	DROP TABLE HttpReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[TypeRepository]'))
	DROP TABLE TypeRepository
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FileTypeRecognizer]'))
	DROP TABLE FileTypeRecognizer
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EntityAnalyzer]'))
	DROP TABLE EntityAnalyzer
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EntityAnalyzer_EntityType]'))
	DROP TABLE EntityAnalyzer_EntityType
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EntityType]'))
	DROP TABLE EntityType
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EntityContainerizer]'))
	DROP TABLE EntityContainerizer
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[TypeSet]'))
	DROP TABLE TypeSet
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[HttpSendChannel]'))
	DROP TABLE HttpSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ediBOXReceiveChannel]'))
	DROP TABLE ediBOXReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ediBOXSendChannel]'))
	DROP TABLE ediBOXSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FileEventListener]'))
	DROP TABLE FileEventListener
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Pop3ReceiveChannel]'))
	DROP TABLE Pop3ReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CoreObjectReader]'))
	DROP TABLE CoreObjectReader
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EdifactReaderConfig]'))
	DROP TABLE EdifactReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SdfReaderConfig]'))
	DROP TABLE SdfReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[HarddiskSendChannel]'))
	DROP TABLE HarddiskSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[HarddiskReceiveChannel]'))
	DROP TABLE HarddiskReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SmtpSendChannel]'))
	DROP TABLE SmtpSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FixedLengthReaderConfig]'))
	DROP TABLE FixedLengthReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[XmlReaderConfig]'))
	DROP TABLE XmlReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CoreObjectWriter]'))
	DROP TABLE CoreObjectWriter
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[EdifactWriterConfig]'))
	DROP TABLE EdifactWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SdfWriterConfig]'))
	DROP TABLE SdfWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FixedLengthWriterConfig]'))
	DROP TABLE FixedLengthWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[XmlWriterConfig]'))
	DROP TABLE XmlWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SapIDocWriterConfig]'))
	DROP TABLE SapIDocWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SapIDocReaderConfig]'))
	DROP TABLE SapIDocReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Location]'))
	DROP TABLE Location
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[LocationLookup]'))
	DROP TABLE LocationLookup
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AS2ReceiveChannel]'))
	DROP TABLE AS2ReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AS2SendChannel]'))
	DROP TABLE AS2SendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SmtpReceiveChannel]'))
	DROP TABLE SmtpReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Pop3SendChannel]'))
	DROP TABLE Pop3SendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ChannelProxyEventListener]'))
	DROP TABLE ChannelProxyEventListener
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FilenameGenerator]'))
	DROP TABLE FilenameGenerator
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FtpSendChannel]'))
	DROP TABLE FtpSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[FtpReceiveChannel]'))
	DROP TABLE FtpReceiveChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleAttribute]'))
	DROP TABLE ArticleAttribute
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CounterDef]'))
	DROP TABLE CounterDef
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[CounterValue]'))
	DROP TABLE CounterValue
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[SubjectGenerator]'))
	DROP TABLE SubjectGenerator
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AnsiX12ReaderConfig]'))
	DROP TABLE AnsiX12ReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AnsiX12WriterConfig]'))
	DROP TABLE AnsiX12WriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[XmlReaderExConfig]'))
	DROP TABLE XmlReaderExConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ShoeTransactionSendChannel]'))
	DROP TABLE ShoeTransactionSendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ShoeTransactionResponseChannel]'))
	DROP TABLE ShoeTransactionResponseChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ediBoxInhouseReaderConfig]'))
	DROP TABLE ediBoxInhouseReaderConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ediBoxInhouseWriterConfig]'))
	DROP TABLE ediBoxInhouseWriterConfig
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[VariableDefinition]'))
	DROP TABLE VariableDefinition
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[VariableInstance]'))
	DROP TABLE VariableInstance
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[AssemblySchemaVersion]'))
	DROP TABLE AssemblySchemaVersion
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticlePool]'))
	DROP TABLE ArticlePool
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleEAN]'))
	DROP TABLE ArticleEAN
	
	GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Preislinien]'))
	DROP TABLE Preislinien
	
	GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[PreislinienAbo]'))
	DROP TABLE PreislinienAbo
	
	GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleDetailPreislinien]'))
	DROP TABLE ArticleDetailPreislinien
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[Reports]'))
	DROP TABLE Reports
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[X400SendChannel]'))
	DROP TABLE X400SendChannel
GO
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[X400ReceiveChannel]'))
	DROP TABLE X400ReceiveChannel
GO

IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleDetailCustomItems]'))
	DROP TABLE ArticleDetailCustomItems
GO

IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[ArticleDetailArticleText]'))
	DROP TABLE ArticleDetailArticleText
GO

IF EXISTS (select * from dbo.sysobjects where id = object_id(N'[PartnerLanguage]'))
	DROP TABLE PartnerLanguage
GO



-- end

-- end table cleanup script part

-- begin table-creation script part
-- create table for persistent class Node
CREATE TABLE Node (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	ParentNode_oid	uniqueidentifier,
	DefaultSystemPartner_oid	uniqueidentifier,
	DefaultTemplatePartner_oid	uniqueidentifier,
	Level	int default -1,
	CONSTRAINT PKEY_Node_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class User
CREATE TABLE eBissUser (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	Password	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	ViewMode	smallint,
	NotificationAddress	varchar(254),
	CONSTRAINT PKEY_eBissUser_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AccessRight
CREATE TABLE AccessRight (
	Oid	uniqueidentifier NOT NULL,
	CanCreateUsers	bit,
	Node_oid	uniqueidentifier NOT NULL,
	User_oid	uniqueidentifier NOT NULL,
	CanCreateNodes	bit,
	CanEditJobs	bit,
	CanCreateJobs	bit,
	CanChangeSelf	bit,
	CanCreateChannels	bit,
	CanCreateTradingPartners	bit,
	CanCreateSystemPartners	bit,
	CanCreateMaps bit,
	CanEditMaps bit,
	CanCreateRepository  bit,
	CanCreateMessageBox  bit,
	CanDeleteMaps  bit,
	CanDeleteJobs  bit,
	CanDeleteNodes  bit,
	CanDeleteRepository bit,
	CanDeleteMessageBox bit,
	CanDeleteChannel bit,
	CanDeletePartner bit,
	CONSTRAINT PKEY_AccessRight_Oid PRIMARY KEY (Oid),
	CONSTRAINT UNIQUE_AccessRight_UniqueNode UNIQUE (User_oid, Node_oid))
GO

-- create table for persistent class JobDef
CREATE TABLE JobDef (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	Owner_oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	Flags	smallint,
	Description	varchar(256),
	JobBytes	image,
	VersionString	varchar(64),
	LastModified	datetime,
	LastModifiedBy_oid	uniqueidentifier,
	IsPublic	bit,
	CONSTRAINT PKEY_JobDef_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class RuntimeSession
CREATE TABLE RuntimeSession (
	Oid	uniqueidentifier NOT NULL,
	StartDate	datetime,
	EndDate	datetime,
	State	smallint,
	User_oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_RuntimeSession_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AddressBase
CREATE TABLE AddressBase (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	AddressType	smallint,
	Uri	varchar(254),
	Options	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	Partner_oid	uniqueidentifier NOT NULL,
	IsDefault	bit,
	CompressionMode	smallint,
	CONSTRAINT PKEY_AddressBase_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE TypeSet_AddressBase (
	TypeSet_oid	uniqueidentifier NOT NULL,
	AddressBase_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_TypeSet_AddressBase_TypeSet_oid_AddressBase_oid PRIMARY KEY (TypeSet_oid, AddressBase_oid))
GO

-- create table for persistent class MessageBox
CREATE TABLE MessageBox (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	BoxType	smallint,
	FilterMaxState	smallint,
	FilterMinTaskState	smallint,
	FilterNewerThanMinutes	int,
	CONSTRAINT PKEY_MessageBox_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Message
CREATE TABLE Message (
	Oid	uniqueidentifier NOT NULL,
	_Key	varchar(64),
	Subject	varchar(256),
	RefExternal	varchar(128),
	ComAddressType	smallint,
	ComRef	varchar(128),
	ComSender	varchar(128),
	ComReceiver	varchar(128),
	Analyzed	bit,
	EntryDate	datetime,
	EntryPath	varchar(64),
	DelegatedJob_oid	uniqueidentifier,
	MessageBox_oid	uniqueidentifier NOT NULL,
	Size	int,
	OwnLocation_oid	uniqueidentifier,
	Partner_oid	uniqueidentifier,
	Direction	smallint NOT NULL,
	ComNotificationReceiver	varchar(128),
	ComMd5HashBase64	varchar(64),
	ComSha1HashBase64	varchar(64),
	NotificationRequested	bit,
	IsNotificationMessage	bit,
	State	smallint,
	TaskState	smallint,
	LevelTaskState	smallint,
	CONSTRAINT PKEY_Message_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE ProcessInstance_Message (
	ProcessInstance_oid	uniqueidentifier NOT NULL,
	Message_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_ProcessInstance_Message_ProcessInstance_oid_Message_oid PRIMARY KEY (ProcessInstance_oid, Message_oid))
GO

-- create table for persistent class Attachment
CREATE TABLE Attachment (
	Oid	uniqueidentifier NOT NULL,
	Message_oid	uniqueidentifier NOT NULL,
	Filename	varchar(254),
	EdiFileType	smallint,
	EntityAnalyzer_oid	uniqueidentifier,
	Size	int,
	State	smallint,
	TaskState	smallint,
	SequenceNumber	int,
	LevelTaskState	smallint,
	CONSTRAINT PKEY_Attachment_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Interchange
CREATE TABLE Interchange (
	Oid	uniqueidentifier NOT NULL,
	Attachment_oid	uniqueidentifier NOT NULL,
	EdiSender	varchar(64),
	EdiRecipient	varchar(64),
	EdiReference	varchar(64),
	Partner_oid	uniqueidentifier,
	OwnLocation_oid	uniqueidentifier,
	RawContent	varchar(4096),
	State	smallint,
	TaskState	smallint,
	SequenceNumber	int,
	StartOffset	int,
	LevelTaskState	smallint,
	CONSTRAINT PKEY_Interchange_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Document
CREATE TABLE Document (
	Oid	uniqueidentifier NOT NULL,
	Interchange_oid	uniqueidentifier NOT NULL,
	Message_oid	uniqueidentifier NOT NULL,
	DocType	varchar(64),
	DocSubType	varchar(64),
	StandardMain	varchar(64),
	StandardSub	varchar(64),
	StandardVersion	varchar(64),
	CommunicationId	varchar(64),
	DocNumber	varchar(64),
	DocDate	varchar(64),
	State	smallint,
	EntityType_oid	uniqueidentifier,
	OriginDocument_oid	uniqueidentifier,
	TaskState	smallint,
	SequenceNumber	int,
	StartOffset	int,
	LevelTaskState	smallint,
	SystemLocation_oid	uniqueidentifier,
	PartnerLocation_oid	uniqueidentifier,
	CONSTRAINT PKEY_Document_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class MapDef
CREATE TABLE MapDef (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	Description	varchar(256),
	VersionString	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	Owner_oid	uniqueidentifier NOT NULL,
	MapBytes	image,
	LastModified	datetime,
	LastModifiedBy_oid	uniqueidentifier,
	SourceTypeName	varchar(64),
	TargetTypeName	varchar(64),
	IsPublic	bit,
	CONSTRAINT PKEY_MapDef_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LookupTableType
CREATE TABLE LookupTableType (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	ValueProvider_oid	uniqueidentifier NOT NULL,
	AutoAddNewTables	bit,
	AutoAddKeysDefault	bit,
	CONSTRAINT PKEY_LookupTableType_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LookupTable
CREATE TABLE LookupTable (
	Oid	uniqueidentifier NOT NULL,
	LookupTableType_oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	_Public	bit,
	AutoAddKeys	bit,
	CONSTRAINT PKEY_LookupTable_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LookupTableEntry
CREATE TABLE LookupTableEntry (
	Oid	uniqueidentifier NOT NULL,
	LookupTable_oid	uniqueidentifier NOT NULL,
	_Key	varchar(64),
	Description	varchar(128),
	ValueEntry_oid	uniqueidentifier,
	LastRequested	datetime,
	CONSTRAINT PKEY_LookupTableEntry_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LookupTableValueProvider
CREATE TABLE LookupTableValueProvider (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	BackendLookupProviderTypeName	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	BackendLookupProviderReference	varchar(64),
	CONSTRAINT PKEY_LookupTableValueProvider_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LookupTableValueProviderEntry
CREATE TABLE LookupTableValueProviderEntry (
	Oid	uniqueidentifier NOT NULL,
	ValueProvider_oid	uniqueidentifier NOT NULL,
	Val	varchar(64),
	Description	varchar(128),
	CONSTRAINT PKEY_LookupTableValueProviderEntry_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Partner
CREATE TABLE Partner (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	TNr	varchar(64),
	Memo	varchar(2048),
	Type	smallint NOT NULL,
	LastSentInterchangeReference	int,
	LastSentDocumentReference	int,
	LastReceivedInterchangeReference	int,
	LastReceivedDocumentReference	int,
	Channel_oid	uniqueidentifier,
	Preislinien_oid uniqueidentifier,
	Containerizer_oid	uniqueidentifier,
	MainLocation_oid	uniqueidentifier,
	Node_oid	uniqueidentifier NOT NULL,
	Template_oid	uniqueidentifier,
	PartnerLanguage_oid uniqueidentifier,
	CONSTRAINT PKEY_Partner_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Article
CREATE TABLE Article (
	Oid	uniqueidentifier NOT NULL,
	SupplierGLN	varchar(14),
	ManufacturerGLN	varchar(14),
	BuyerGLN	varchar(14),
	ArticleNumber	varchar(40),
	Node_oid	uniqueidentifier NOT NULL,
	Location_oid	uniqueidentifier NOT NULL,
	LastChange	datetime,
	LastReceiveDate datetime,
	CONSTRAINT PKEY_Article_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ArticleDetail
CREATE TABLE ArticleDetail (
	Oid	uniqueidentifier NOT NULL,
	Article_oid	uniqueidentifier NOT NULL,
	Color	varchar(40),
	Size	varchar(64),
	Size2	varchar(40),
	ProductGroup	varchar(40),
	ArticleDescription	varchar(64),
	ArticleNumber	varchar(40),
	BrandName	varchar(40),
	SubBrandName	varchar(40),
	CustomsItemNumber	varchar(20),
	OriginCountry	varchar(3),
	Season	varchar(40),
	ArticleClass	varchar(3),
	MinimumOrderQuantity	int,
	PackagingQuantity	int,
	ArticleDetailPreislinien_oid uniqueidentifier ,
	EffectivePurchasePrice	decimal(10,3),
	ListPurchasePrice	decimal(10,3),
	PurchasePriceCurrency	varchar(3),
	SuggestedRetailPrice	decimal(10,3),
	RetailPriceCurrency	varchar(3),
	ValidFrom	datetime,
	ValidTo	datetime,
	CreationTime	datetime,
	ModificationTime	datetime,
	LastTouched	datetime,
	BackendReference	varchar(40),
	BackendAccepted	bit,
	BackendAcceptedTime	datetime,
	Ean	varchar(20),
	DTBProductGroup	int,
	BTEProductGroup	int,
	PosAction	smallint,
	Node_oid	uniqueidentifier NOT NULL,
	ColorAttribute_oid	uniqueidentifier,
	SizeAttribute_oid	uniqueidentifier,
	ProductGroupAttribute_oid	uniqueidentifier,
	StandardProductGroup	varchar(64),
	StandardColor	varchar(64),
	StandardSize	varchar(64),
	AdditionalScanCode	varchar(25),
	ExtensionField1	varchar(64),
	ExtensionField2	varchar(64),
	FashionTheme	varchar(40),	
	CONSTRAINT PKEY_ArticleDetail_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class DocMatch
CREATE TABLE DocMatch (
	Oid	uniqueidentifier NOT NULL,
	Partner_oid	uniqueidentifier NOT NULL,
	DocType	varchar(64),
	DocSubType	varchar(64),
	StandardMain	varchar(64),
	StandardSub	varchar(64),
	StandardVersion	varchar(64),
	PartnerMatchString	varchar(64),
	StandardMapping_oid	uniqueidentifier,
	SpecialMapping_oid	uniqueidentifier,
	CONSTRAINT PKEY_DocMatch_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ArticleSubscription
CREATE TABLE ArticleSubscription (
	Oid	uniqueidentifier NOT NULL,
	FieldName	varchar(64),
	Value	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	Location_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_ArticleSubscription_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Task
CREATE TABLE Task (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	ResponsibleUser_oid	uniqueidentifier,
	TaskMessage	smallint,
	ProcessInstance_oid	uniqueidentifier,
	ResolvObjectReference_oid	uniqueidentifier,
	Done	bit,
	CreationDate	datetime,
	DoneDate	datetime,
	Info	text,
	NotificationSent	bit,
	CONSTRAINT PKEY_Task_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE Task_ObjectReference (
	Task_oid	uniqueidentifier NOT NULL,
	ObjectReference_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_Task_ObjectReference_Task_oid_ObjectReference_oid PRIMARY KEY (Task_oid, ObjectReference_oid))
GO

-- create table for persistent class ProcessInstance
CREATE TABLE ProcessInstance (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	NumOpenEntities	int,
	State	smallint,
	StartDate	datetime,
	LastTouched	datetime,
	Name	varchar(64),
	RuntimeSession_oid	uniqueidentifier NOT NULL,
	EndDate	datetime,
	ProcessLog	varchar(64),
	CONSTRAINT PKEY_ProcessInstance_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ObjectReference
CREATE TABLE ObjectReference (
	Oid	uniqueidentifier NOT NULL,
	TypeName	varchar(64),
	RefOid	uniqueidentifier,
	CONSTRAINT PKEY_ObjectReference_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ScheduleEvent
CREATE TABLE ScheduleEvent (
	Oid	uniqueidentifier NOT NULL,
	NextTime	datetime,
	CoreEventListener_oid	uniqueidentifier,
	CONSTRAINT PKEY_ScheduleEvent_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ScheduleTime
CREATE TABLE ScheduleTime (
	Oid	uniqueidentifier NOT NULL,
	ScheduleEvent_oid	uniqueidentifier NOT NULL,
	IsException	bit,
	Month	smallint,
	DayOfMonth	int,
	DayOfWeek	smallint,
	Hour	int,
	Minute	int,
	CONSTRAINT PKEY_ScheduleTime_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class PortEventListener
CREATE TABLE PortEventListener (
	Oid	uniqueidentifier NOT NULL,
	Port	int NOT NULL,
	CoreEventListener_oid	uniqueidentifier,
	BindInterfaceIP	varchar(64),
	CONSTRAINT PKEY_PortEventListener_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CoreEventListener
CREATE TABLE CoreEventListener (
	Oid	uniqueidentifier NOT NULL,
	Name	VARCHAR(120) NOT NULL,
	Active	bit,
	JobDef_oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	ListenerTypeName	varchar(64) NOT NULL,
	LastTimeTriggered	datetime,
	User_oid	uniqueidentifier NOT NULL,
	LastChanged	datetime,
	LastChangeSessionId	uniqueidentifier,
	CONSTRAINT PKEY_CoreEventListener_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class PortAccessRule
CREATE TABLE PortAccessRule (
	Oid	uniqueidentifier NOT NULL,
	PortEventListener_oid	uniqueidentifier NOT NULL,
	IsException	bit,
	Host	varchar(64),
	Netmask	varchar(64),
	CONSTRAINT PKEY_PortAccessRule_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CoreChannel
CREATE TABLE CoreChannel (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	ChannelTypeName	varchar(64) NOT NULL,
	MessageBox_oid	uniqueidentifier NOT NULL,
	ChannelDirection	smallint NOT NULL,
	Name	varchar(64) NOT NULL,
	MessageDirection	smallint NOT NULL,
	SenderValidation	smallint,
	RecipientValidation	smallint,
	DefaultSender_oid	uniqueidentifier,
	DefaultRecipient_oid	uniqueidentifier,
	AutoUncompress	smallint,
	dbPublic	bit,
	CONSTRAINT PKEY_CoreChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HttpReceiveChannel
CREATE TABLE HttpReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	URI	varchar(64),
	UseTLS	bit,
	CertificateFile	varchar(64),
	PositiveAnswerDocument	text,
	SendAnswerDocuments	bit,
	NegativeAnswerDocument	text,
	ProxyBehaviour	smallint,
	CONSTRAINT PKEY_HttpReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class TypeRepository
CREATE TABLE TypeRepository (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	Name	varchar(64) default 'Repository' NOT NULL,
	IsPublic	bit,
	CONSTRAINT PKEY_TypeRepository_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FileTypeRecognizer
CREATE TABLE FileTypeRecognizer (
	Oid	uniqueidentifier NOT NULL,
	TypeRepository_oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	Active	bit NOT NULL,
	RecognizerTypeName	varchar(64),
	Direction	smallint NOT NULL,
	FileMask	varchar(64),
	MatchString	varchar(100),
	CharacterEncoding	varchar(64),
	CONSTRAINT PKEY_FileTypeRecognizer_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class EntityAnalyzer
CREATE TABLE EntityAnalyzer (
	Oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	AnalyzerTypeName	varchar(64) NOT NULL,
	Repository_oid	uniqueidentifier NOT NULL,
	Recognizer_oid	uniqueidentifier NOT NULL,
	ObjectReaderTypeName	varchar(64),
	CoreObjectReader_oid	uniqueidentifier NOT NULL,
	PartnerIdentification	smallint,
	UseDifferentIdentificationForSystemPartner	bit,
	SystemPartnerIdentification	smallint,
	CONSTRAINT PKEY_EntityAnalyzer_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE EntityAnalyzer_EntityType (
	EntityAnalyzer_oid	uniqueidentifier NOT NULL,
	EntityType_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_EntityAnalyzer_EntityType_EntityAnalyzer_oid_EntityType_oid PRIMARY KEY (EntityAnalyzer_oid, EntityType_oid))
GO

-- create table for persistent class EntityType
CREATE TABLE EntityType (
	Oid	uniqueidentifier NOT NULL,
	Repository_oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	EntityTypeName	varchar(64) NOT NULL,
	DefaultContainerizer_oid	uniqueidentifier,
	DefaultObjectWriter_oid	uniqueidentifier,
	DefaultObjectReader_oid	uniqueidentifier,
	DocumentSubType	varchar(64),
	CONSTRAINT PKEY_EntityType_Oid PRIMARY KEY (Oid),
	CONSTRAINT UNIQUE_EntityType_Types UNIQUE (Repository_oid, EntityTypeName, DocumentSubType))
GO

-- create table for persistent class EntityContainerizer
CREATE TABLE EntityContainerizer (
	Oid	uniqueidentifier NOT NULL,
	Repository_oid	uniqueidentifier NOT NULL,
	ContainerizerTypeName	varchar(64) NOT NULL,
	Scope	smallint NOT NULL,
	Name	varchar(64) NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier,
	FNameGenFilenameGeneration	smallint,
	FNameGenFilenameMask	varchar(256),
	FNameGenUseBadCharReplacing	bit,
	FNameGenBadCharReplacingMethod	smallint,
	SNameGenSubjectGeneration	smallint,
	SNameGenSubjectMask	varchar(256),
	CONSTRAINT PKEY_EntityContainerizer_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class TypeSet
CREATE TABLE TypeSet (
	Oid	uniqueidentifier NOT NULL,
	Partner_oid	uniqueidentifier NOT NULL,
	Direction	smallint,
	Type_oid	uniqueidentifier,
	TargetType_oid	uniqueidentifier,
	CoreChannel_oid	uniqueidentifier,
	EntityContainerizer_oid	uniqueidentifier,
	Mapping_oid	uniqueidentifier,
	CONSTRAINT PKEY_TypeSet_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HttpSendChannel
CREATE TABLE HttpSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	Authenticate	bit,
	AuthenticateUser	varchar(64),
	AuthenticatePassword	varchar(64),
	AuthenticateDomain	varchar(64),
	MimeType	varchar(64),
	HttpVersion	varchar(5),
	BaseURI	varchar(64),
	CONSTRAINT PKEY_HttpSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ediBOXReceiveChannel
CREATE TABLE ediBOXReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	SlotType	smallint,
	SlotName	varchar(64),
	CONSTRAINT PKEY_ediBOXReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ediBOXSendChannel
CREATE TABLE ediBOXSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	SlotType	smallint,
	SlotName	varchar(64),
	CONSTRAINT PKEY_ediBOXSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FileEventListener
CREATE TABLE FileEventListener (
	Oid	uniqueidentifier NOT NULL,
	CoreEventListener_oid	uniqueidentifier,
	WatchMask	varchar(64) NOT NULL,
	CONSTRAINT PKEY_FileEventListener_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Pop3ReceiveChannel
CREATE TABLE Pop3ReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	Username	varchar(64) NOT NULL,
	Password	varchar(64),
	Host	varchar(64) NOT NULL,
	Port	int NOT NULL,
	Authentification	smallint NOT NULL,
	DeleteReceivedMessages	bit,
	SslHandling	smallint,
	SslClientCertPfxFile	varchar(64),
	SslClientCertPfxPassword	varchar(64),
	CONSTRAINT PKEY_Pop3ReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CoreObjectReader
CREATE TABLE CoreObjectReader (
	Oid	uniqueidentifier NOT NULL,
	Repository_oid	uniqueidentifier NOT NULL,
	CharacterEncoding	varchar(64),
	Name	varchar(64),
	ReaderConfigTypeName	varchar(64) NOT NULL,
	CONSTRAINT PKEY_CoreObjectReader_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class EdifactReaderConfig
CREATE TABLE EdifactReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	IgnoreUnknownUnUsSegments bit,
	CoreObjectReader_oid	uniqueidentifier,
	CONSTRAINT PKEY_EdifactReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SdfReaderConfig
CREATE TABLE SdfReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	Seperator	smallint,
	RecordTagPosition	int,
	ExtendedParser	bit,
	OpenBrackets	varchar(64),
	CloseBrackets	varchar(64),
	EscapeChars	varchar(64),
	AdditionalSeperators	varchar(64),
	CONSTRAINT PKEY_SdfReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HarddiskSendChannel
CREATE TABLE HarddiskSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	OutputPath	varchar(256) NOT NULL,
	FileNameHandling	smallint,
	FileExistsHandling	smallint,
	CONSTRAINT PKEY_HarddiskSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HarddiskReceiveChannel
CREATE TABLE HarddiskReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	InputPath	varchar(256) NOT NULL,
	DeleteAcceptedFiles	bit,
	InputFileMask	varchar(64),
	FileHandling	smallint,
	MoveToPath	varchar(256),
	CONSTRAINT PKEY_HarddiskReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SmtpSendChannel
CREATE TABLE SmtpSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	Username	varchar(64),
	Password	varchar(64),
	Host	varchar(64) NOT NULL,
	Port	int NOT NULL,
	Authentification	smallint NOT NULL,
	MailFrom	varchar(64),
	SendSingleAttachmentsAsBody	bit,
	RequestNotification	smallint,
	NotificationHash	smallint,
	UseSenderAddressAsFrom	bit,
	SslHandling	smallint,
	SslClientCertPfxFile	varchar(64),
	SslClientCertPfxPassword	varchar(64),
	CONSTRAINT PKEY_SmtpSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FixedLengthReaderConfig
CREATE TABLE FixedLengthReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	RecordTagLength	int,
	RecordTagPosition	int,
	SearchPartial	bit,
	CONSTRAINT PKEY_FixedLengthReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class XmlReaderConfig
CREATE TABLE XmlReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	CONSTRAINT PKEY_XmlReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CoreObjectWriter
CREATE TABLE CoreObjectWriter (
	Oid	uniqueidentifier NOT NULL,
	Repository_oid	uniqueidentifier NOT NULL,
	Name	varchar(64),
	WriterConfigTypeName	varchar(64) NOT NULL,
	CharacterEncoding	varchar(64),
	CONSTRAINT PKEY_CoreObjectWriter_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class EdifactWriterConfig
CREATE TABLE EdifactWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier,
	WriteLinebreak	bit,
	ContainerizationSuppressUNA	bit,
	CONSTRAINT PKEY_EdifactWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SdfWriterConfig
CREATE TABLE SdfWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	Seperator	smallint,
	CONSTRAINT PKEY_SdfWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FixedLengthWriterConfig
CREATE TABLE FixedLengthWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_FixedLengthWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class XmlWriterConfig
CREATE TABLE XmlWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	XMLBehaviour	smallint,
	ContainerizationRootPath	varchar(64),
	SupressXmlStandAlone	bit,
	WriteEmptyTag bit,
	CONSTRAINT PKEY_XmlWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SapIDocWriterConfig
CREATE TABLE SapIDocWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_SapIDocWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SapIDocReaderConfig
CREATE TABLE SapIDocReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	CONSTRAINT PKEY_SapIDocReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Location
CREATE TABLE Location (
	Oid	uniqueidentifier NOT NULL,
	Partner_oid	uniqueidentifier NOT NULL,
	Type	smallint NOT NULL,
	BackendReference_oid	uniqueidentifier,
	GLN	varchar(64),
	Name	varchar(64),
	Name2	varchar(64),
	Street	varchar(64),
	Street2	varchar(64),
	ZipCode	varchar(12),
	City	varchar(64),
	Country	varchar(64),
	Notes	varchar(2048),
	Node_oid	uniqueidentifier,
	PartnerType	smallint,
	CONSTRAINT PKEY_Location_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class LocationLookup
CREATE TABLE LocationLookup (
	Oid	uniqueidentifier NOT NULL,
	Location_oid	uniqueidentifier NOT NULL,
	TableType_oid	uniqueidentifier NOT NULL,
	Table_oid	uniqueidentifier,
	Enabled	bit,
	ValueRequired	bit,
	AddNewKeys	bit,
	CONSTRAINT PKEY_LocationLookup_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AS2ReceiveChannel
CREATE TABLE AS2ReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	AS2LogPath	varchar(64),
	SignerCertCsrFile	varchar(64),
	OwnCertPfxFile	varchar(64),
	OwnCertPassword	varchar(64),
	OwnCertSubject	varchar(64),
	UseSsl	bit,
	SslServerCertPfxFile	varchar(64),
	SslServerCertPassword	varchar(64),
	CONSTRAINT PKEY_AS2ReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AS2SendChannel
CREATE TABLE AS2SendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	Url	varchar(254) NOT NULL,
	AS2Sender	varchar(64),
	ContentType	varchar(64),
	UseSenderAddressAsFrom	bit,
	AS2LogPath	varchar(64),
	RequestMDNTo	varchar(64),
	SendFromAnToHeaders	bit,
	AsynchronousReceiptTo	varchar(64),
	UseInternalZLibCompression	bit,
	RequestSignedMdn	bit,
	SigningCertPfxFile	varchar(64),
	SigningCertPassword	varchar(64),
	SslClientCertPfxFile	varchar(64),
	SslClientCertPassword	varchar(64),
	RecipientCertCerFile	varchar(64),
	SignMessage	bit,
	CryptMessageAlgorithm	varchar(64),
	AcceptServerCertCerFile	varchar(64),
	SigningCertSubject	varchar(64),
	SslClientCertSubject	varchar(64),
	Timeout	int,
	CONSTRAINT PKEY_AS2SendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SmtpReceiveChannel
CREATE TABLE SmtpReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	RecipientValidation	smallint,
	DomainList	varchar(2048),
	Authentification	smallint,
	ProxyBehaviour	smallint,
	SslHandling	smallint,
	SslServerCertPfxFile	varchar(64),
	SslServerCertPfxPassword	varchar(64),
	CONSTRAINT PKEY_SmtpReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class Pop3SendChannel
CREATE TABLE Pop3SendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	NotificationHash	smallint,
	UseSenderAddressAsFrom	bit,
	MailFrom	varchar(64),
	SendSingleAttachmentsAsBody	bit,
	RequestNotification	smallint,
	SslHandling	smallint,
	SslServerCertPfxFile	varchar(64),
	SslServerCertPfxPassword	varchar(64),
	CONSTRAINT PKEY_Pop3SendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ChannelProxyEventListener
CREATE TABLE ChannelProxyEventListener (
	Oid	uniqueidentifier NOT NULL,
	CoreEventListener_oid	uniqueidentifier,
	ChannelTypeName	varchar(64),
	ListenUri	varchar(64),
	UseListenUri	bit,
	CONSTRAINT PKEY_ChannelProxyEventListener_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FilenameGenerator
CREATE TABLE FilenameGenerator (
	Oid	uniqueidentifier NOT NULL,
	FilenameGeneration	smallint,
	FilenameMask	varchar(256),
	UseBadCharReplacing	bit,
	BadCharReplacingMethod	smallint,
	CONSTRAINT PKEY_FilenameGenerator_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FtpSendChannel
CREATE TABLE FtpSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	OutputPath	varchar(256) NOT NULL,
	FileNameHandling	smallint,
	FileExistsHandling	smallint,
	Host	varchar(64) NOT NULL,
	Port	int NOT NULL,
	Username	varchar(64),
	Password	varchar(64),
	UseTemporaryTransportFileName	bit,
	TemporaryTransportFileName	varchar(64),
	CONSTRAINT PKEY_FtpSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class FtpReceiveChannel
CREATE TABLE FtpReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	InputPath	varchar(256) NOT NULL,
	InputFileMask	varchar(64),
	Host	varchar(64) NOT NULL,
	Port	int NOT NULL,
	Username	varchar(64),
	Password	varchar(64),
	DeleteAcceptedFiles	bit,
	CONSTRAINT PKEY_FtpReceiveChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ArticleAttribute
CREATE TABLE ArticleAttribute (
	Oid	uniqueidentifier NOT NULL,
	Location_oid	uniqueidentifier NOT NULL,
	Type	smallint NOT NULL,
	Id	varchar(64) NOT NULL,
	Text	varchar(64),
	CONSTRAINT PKEY_ArticleAttribute_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CounterDef
CREATE TABLE CounterDef (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	_Public	bit,
	FirstValue	bigint NOT NULL,
	Max	bigint NOT NULL,
	Increment	int NOT NULL,
	OverflowHandling	smallint,
	CONSTRAINT PKEY_CounterDef_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class CounterValue
CREATE TABLE CounterValue (
	Oid	uniqueidentifier NOT NULL,
	CounterDef_oid	uniqueidentifier NOT NULL,
	RefName	varchar(64) NOT NULL,
	CurrentValue	bigint NOT NULL,
	CONSTRAINT PKEY_CounterValue_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class SubjectGenerator
CREATE TABLE SubjectGenerator (
	Oid	uniqueidentifier NOT NULL,
	SubjectGeneration	smallint,
	SubjectMask	varchar(256),
	CONSTRAINT PKEY_SubjectGenerator_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AnsiX12ReaderConfig
CREATE TABLE AnsiX12ReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	CONSTRAINT PKEY_AnsiX12ReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AnsiX12WriterConfig
CREATE TABLE AnsiX12WriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_AnsiX12WriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class XmlReaderExConfig
CREATE TABLE XmlReaderExConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	UseOfAdditionalXmlRootTag bit,
	CONSTRAINT PKEY_XmlReaderExConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ShoeTransactionSendChannel
CREATE TABLE ShoeTransactionSendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	Url	varchar(128) NOT NULL,
	AuthUserName	varchar(64) NOT NULL,
	AuthPassword	varchar(64) NOT NULL,
	TransactionType	varchar(64),
	TimeoutSeconds	int,
	CONSTRAINT PKEY_ShoeTransactionSendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ShoeTransactionResponseChannel
CREATE TABLE ShoeTransactionResponseChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	ImmediateCommit	bit,
	CONSTRAINT PKEY_ShoeTransactionResponseChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ediBoxInhouseReaderConfig
CREATE TABLE ediBoxInhouseReaderConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectReader_oid	uniqueidentifier,
	CONSTRAINT PKEY_ediBoxInhouseReaderConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ediBoxInhouseWriterConfig
CREATE TABLE ediBoxInhouseWriterConfig (
	Oid	uniqueidentifier NOT NULL,
	CoreObjectWriter_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_ediBoxInhouseWriterConfig_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class VariableDefinition
CREATE TABLE VariableDefinition (
	Oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	Name	varchar(64) NOT NULL,
	Type	smallint NOT NULL,
	Description	varchar(256),
	DefaultValue	varchar(256),
	IsSystemLocationBindable	bit,
	IsTradingPartnerLocationBindable	bit,
	LookupTableValueProvider_oid	uniqueidentifier,
	CONSTRAINT PKEY_VariableDefinition_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class VariableInstance
CREATE TABLE VariableInstance (
	Oid	uniqueidentifier NOT NULL,
	VariableDefinition_oid	uniqueidentifier NOT NULL,
	Value	varchar(256),
	Location_oid	uniqueidentifier,
	CONSTRAINT PKEY_VariableInstance_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class AssemblySchemaVersion
CREATE TABLE AssemblySchemaVersion (
	Oid	uniqueidentifier NOT NULL,
	AssemblyName	varchar(64) NOT NULL,
	Version	varchar(64),
	LastUpgrade	datetime,
	CONSTRAINT PKEY_AssemblySchemaVersion_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE Reports (
	Oid	uniqueidentifier NOT NULL,
	Name VARCHAR(64) NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	EntryDate	datetime,
	LastChangeDate	datetime,
	ReportData	image,
	Output VARCHAR(128),
	SourceType VARCHAR(128),
	CONSTRAINT PKEY_Reports_Oid PRIMARY KEY (Oid));
GO
-- create table for persistent class ArticlePool
CREATE TABLE ArticlePool (
	Oid	uniqueidentifier NOT NULL,
	Location_oid	uniqueidentifier NOT NULL,
	Article_oid	uniqueidentifier NOT NULL,
	Node_oid	uniqueidentifier NOT NULL,
	EntryDate	datetime,
	LastChangeDate	datetime,
	LastSendDate	datetime,
	Deactivated	bit,
	CONSTRAINT PKEY_ArticlePool_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE Preislinien (
	Oid	uniqueidentifier NOT NULL,
	Bezeichnung	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	PurchasePriceCurrency	VARCHAR(3),
	RetailPriceCurrency	VARCHAR(3),
	ParentPreislinie_oid	uniqueidentifier,
	Level	int default -1,
	CONSTRAINT PKEY_Preislinien_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE PreislinienAbo (
	Oid	uniqueidentifier NOT NULL,
	LocationOid	uniqueidentifier,
	CONSTRAINT PKEY_PreislinienAbo_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE ArticleDetailPreislinien (
	Oid	uniqueidentifier NOT NULL,
	LocationOid	uniqueidentifier,
	ArticleDetail_oid	uniqueidentifier NOT NULL,
	Preislinien_oid	uniqueidentifier NOT NULL,
	EffectivePurchasePrice	decimal(10,3),
	ListPurchasePrice	decimal(10,3),
	ListPriceCurrency varchar(3),
	PurchasePriceCurrency	varchar(3),
	SuggestedRetailPrice	decimal(10,3),
	RetailPriceCurrency	varchar(3),
	ModificationTime	datetime,
	CreateTime datetime,
	CONSTRAINT PKEY_ArticleDetailPreislinien_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class ArticleEAN
CREATE TABLE ArticleEAN (
	Oid	uniqueidentifier NOT NULL,
	ArticleDetail_oid	uniqueidentifier NOT NULL,
	EAN	varchar(64),
	LastChangeDate	datetime,
	CONSTRAINT PKEY_ArticleEAN_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HarddiskSendChannel
CREATE TABLE X400SendChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,

	Country varchar(10) NOT NULL,
	ADMD varchar(64) NOT NULL,
	Organisation varchar(64) NOT NULL,
	Surname varchar(64) ,
	GivenName varchar(64),
	Password varchar(64),
	OrganisationalUnit1 varchar(64),
	AdditionalX400Identifiers varchar(256),
	CharSet varchar(3),
	DeleteTemporaryDirectory bit,
	
	CONSTRAINT PKEY_X400SendChannel_Oid PRIMARY KEY (Oid))
GO

-- create table for persistent class HarddiskReceiveChannel
CREATE TABLE X400ReceiveChannel (
	Oid	uniqueidentifier NOT NULL,
	CoreChannel_oid	uniqueidentifier,
	
	Country varchar(10) NOT NULL,
	ADMD varchar(64) NOT NULL,
	Organisation varchar(64) NOT NULL,
	Surname varchar(64) ,
	GivenName varchar(64),
	Password varchar(64),
	OrganisationalUnit1 varchar(64),
	AdditionalX400Identifiers varchar(256),
	CharSet varchar(3),
	DeleteTemporaryDirectory bit,
	FetchMask varchar(64),
	
	CONSTRAINT PKEY_X400ReceiveChannel_Oid PRIMARY KEY (Oid))
GO
CREATE TABLE ArticleDetailCustomItems (
	Oid	uniqueidentifier NOT NULL,
	ArticleDetail_oid	uniqueidentifier,
	ItemKey varchar(128),
	ItemValue varchar(256),
	
	CONSTRAINT PKEY_ArticleDetailCustomItems_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE ArticleDetailArticleText (
	Oid	uniqueidentifier NOT NULL,
	ArticleDetail_oid	uniqueidentifier,
	ArticleText varchar(256),
	ArticleShortText varchar(256),
	ColorDescription varchar(256),
	ProductGroup varchar(256),
	PartnerLanguage_oid uniqueidentifier,
	CONSTRAINT PKEY_ArticleDetailArticleText_Oid PRIMARY KEY (Oid))
GO

CREATE TABLE PartnerLanguage (
	Oid	uniqueidentifier NOT NULL,
	Sprache	varchar(64),
	Node_oid	uniqueidentifier NOT NULL,
	CONSTRAINT PKEY_PartnerLanguage_Oid PRIMARY KEY (Oid))
GO


-- end table-creation script part
CREATE INDEX Node_Auto_1 ON Node(ParentNode_oid);
CREATE INDEX Node_Auto_2 ON Node(DefaultSystemPartner_oid);
CREATE INDEX Node_Auto_3 ON Node(DefaultTemplatePartner_oid);
CREATE INDEX eBissUser_Auto_1 ON eBissUser(Node_oid);
CREATE INDEX AccessRight_Auto_1 ON AccessRight(Node_oid);
CREATE INDEX AccessRight_Auto_2 ON AccessRight(User_oid);
CREATE INDEX JobDef_Auto_1 ON JobDef(Node_oid);
CREATE INDEX JobDef_Auto_2 ON JobDef(Owner_oid);
CREATE INDEX JobDef_Auto_3 ON JobDef(LastModifiedBy_oid);
CREATE INDEX RuntimeSession_Auto_1 ON RuntimeSession(User_oid);
CREATE INDEX RuntimeSession_Auto_2 ON RuntimeSession(Node_oid);
CREATE INDEX AddressBase_Auto_1 ON AddressBase(Node_oid);
CREATE INDEX AddressBase_Auto_2 ON AddressBase(Partner_oid);
CREATE INDEX TypeSet_AddressBase_Auto_1 ON TypeSet_AddressBase(TypeSet_oid);
CREATE INDEX TypeSet_AddressBase_Auto_2 ON TypeSet_AddressBase(AddressBase_oid);
CREATE INDEX MessageBox_Auto_1 ON MessageBox(Node_oid);

CREATE INDEX Message_Manual_lookUpAutoIndex0 ON Message(Subject);
CREATE INDEX Message_Manual_lookUpAutoIndex1 ON Message(ComRef);
CREATE INDEX Message_Manual_lookUpAutoIndex2 ON Message(EntryDate);
CREATE INDEX Message_Auto_1 ON Message(DelegatedJob_oid);
CREATE INDEX Message_Auto_2 ON Message(MessageBox_oid);
CREATE INDEX Message_Auto_3 ON Message(OwnLocation_oid);
CREATE INDEX Message_Auto_4 ON Message(Partner_oid);

CREATE INDEX Message_Manual_1_State ON Message(State);

CREATE INDEX ProcessInstance_Message_Auto_1 ON ProcessInstance_Message(ProcessInstance_oid);
CREATE INDEX ProcessInstance_Message_Auto_2 ON ProcessInstance_Message(Message_oid);
CREATE INDEX Attachment_Auto_1 ON Attachment(Message_oid);
CREATE INDEX Attachment_Auto_2 ON Attachment(EntityAnalyzer_oid);
CREATE INDEX Interchange_Auto_1 ON Interchange(Attachment_oid);
CREATE INDEX Interchange_Auto_2 ON Interchange(Partner_oid);
CREATE INDEX Interchange_Auto_3 ON Interchange(OwnLocation_oid);
CREATE INDEX Document_Auto_1 ON Document(Interchange_oid);
CREATE INDEX Document_Auto_2 ON Document(Message_oid);
CREATE INDEX Document_Auto_3 ON Document(EntityType_oid);
CREATE INDEX Document_Auto_4 ON Document(OriginDocument_oid);
CREATE INDEX Document_Auto_5 ON Document(SystemLocation_oid);
CREATE INDEX Document_Auto_6 ON Document(PartnerLocation_oid);
CREATE INDEX MapDef_Auto_1 ON MapDef(Node_oid);
CREATE INDEX MapDef_Auto_2 ON MapDef(Owner_oid);
CREATE INDEX MapDef_Auto_3 ON MapDef(LastModifiedBy_oid);
CREATE INDEX LookupTableType_Auto_1 ON LookupTableType(Node_oid);
CREATE INDEX LookupTableType_Auto_2 ON LookupTableType(ValueProvider_oid);
CREATE INDEX LookupTable_Auto_1 ON LookupTable(LookupTableType_oid);
CREATE INDEX LookupTableEntry_Auto_1 ON LookupTableEntry(LookupTable_oid);
CREATE INDEX LookupTableEntry_Manual_lookUpAutoIndex0 ON LookupTableEntry(_Key);
CREATE INDEX LookupTableEntry_Manual_lookUpAutoIndex2 ON LookupTableEntry(Description);
CREATE INDEX LookupTableEntry_Auto_2 ON LookupTableEntry(ValueEntry_oid);
CREATE INDEX LookupTableValueProvider_Manual_lookUpAutoIndex0 ON LookupTableValueProvider(BackendLookupProviderTypeName);
CREATE INDEX LookupTableValueProvider_Auto_1 ON LookupTableValueProvider(Node_oid);
CREATE INDEX LookupTableValueProvider_Manual_lookUpAutoIndex2 ON LookupTableValueProvider(BackendLookupProviderReference);
CREATE INDEX LookupTableValueProviderEntry_Auto_1 ON LookupTableValueProviderEntry(ValueProvider_oid);
CREATE INDEX LookupTableValueProviderEntry_Manual_lookUpAutoIndex0 ON LookupTableValueProviderEntry(Val);
CREATE INDEX LookupTableValueProviderEntry_Manual_lookUpAutoIndex2 ON LookupTableValueProviderEntry(Description);
CREATE INDEX Partner_Manual_lookUpAutoIndex0 ON Partner(Name);
CREATE INDEX Partner_Manual_lookUpAutoIndex3 ON Partner(TNr);
CREATE INDEX Partner_Auto_1 ON Partner(Channel_oid);
CREATE INDEX Partner_Auto_2 ON Partner(Containerizer_oid);
CREATE INDEX Partner_Auto_3 ON Partner(MainLocation_oid);
CREATE INDEX Partner_Auto_4 ON Partner(Node_oid);
CREATE INDEX Partner_Auto_5 ON Partner(Template_oid);
CREATE INDEX Article_Manual_ArticleNumber ON Article(ArticleNumber);
CREATE INDEX Article_Auto_1 ON Article(Node_oid);
CREATE INDEX Article_Auto_2 ON Article(Location_oid);
CREATE INDEX ArticleDetail_Auto_1 ON ArticleDetail(Article_oid);
CREATE INDEX ArticleDetail_Manual_lookUpAutoIndex0 ON ArticleDetail(ArticleDescription);
CREATE INDEX ArticleDetail_Manual_iArticleNumber ON ArticleDetail(ArticleNumber);
CREATE INDEX ArticleDetail_Manual_lookUpAutoIndex2 ON ArticleDetail(ArticleNumber);
CREATE INDEX ArticleDetail_Manual_iEan ON ArticleDetail(Ean);
CREATE INDEX ArticleDetail_Auto_2 ON ArticleDetail(Node_oid);
CREATE INDEX ArticleDetail_Auto_3 ON ArticleDetail(ColorAttribute_oid);
CREATE INDEX ArticleDetail_Auto_4 ON ArticleDetail(SizeAttribute_oid);
CREATE INDEX ArticleDetail_Auto_5 ON ArticleDetail(ProductGroupAttribute_oid);
CREATE INDEX DocMatch_Auto_1 ON DocMatch(Partner_oid);
CREATE INDEX DocMatch_Auto_2 ON DocMatch(StandardMapping_oid);
CREATE INDEX DocMatch_Auto_3 ON DocMatch(SpecialMapping_oid);
CREATE INDEX ArticleSubscription_Auto_1 ON ArticleSubscription(Node_oid);
CREATE INDEX ArticleSubscription_Auto_2 ON ArticleSubscription(Location_oid);
CREATE INDEX Task_Auto_1 ON Task(Node_oid);
CREATE INDEX Task_Auto_2 ON Task(ResponsibleUser_oid);
CREATE INDEX Task_Auto_3 ON Task(ProcessInstance_oid);
CREATE INDEX Task_Auto_4 ON Task(ResolvObjectReference_oid);
CREATE INDEX Task_ObjectReference_Auto_1 ON Task_ObjectReference(Task_oid);
CREATE INDEX Task_ObjectReference_Auto_2 ON Task_ObjectReference(ObjectReference_oid);
CREATE INDEX ProcessInstance_Auto_1 ON ProcessInstance(Node_oid);
CREATE INDEX ProcessInstance_Auto_2 ON ProcessInstance(RuntimeSession_oid);
CREATE INDEX ScheduleEvent_Auto_1 ON ScheduleEvent(CoreEventListener_oid);
CREATE INDEX ScheduleTime_Auto_1 ON ScheduleTime(ScheduleEvent_oid);
CREATE INDEX PortEventListener_Auto_1 ON PortEventListener(CoreEventListener_oid);
CREATE INDEX CoreEventListener_Auto_1 ON CoreEventListener(JobDef_oid);
CREATE INDEX CoreEventListener_Auto_2 ON CoreEventListener(Node_oid);
CREATE INDEX CoreEventListener_Auto_3 ON CoreEventListener(User_oid);
CREATE INDEX PortAccessRule_Auto_1 ON PortAccessRule(PortEventListener_oid);
CREATE INDEX CoreChannel_Auto_1 ON CoreChannel(Node_oid);
CREATE INDEX CoreChannel_Auto_2 ON CoreChannel(MessageBox_oid);
CREATE INDEX CoreChannel_Auto_3 ON CoreChannel(DefaultSender_oid);
CREATE INDEX CoreChannel_Auto_4 ON CoreChannel(DefaultRecipient_oid);
CREATE INDEX HttpReceiveChannel_Auto_1 ON HttpReceiveChannel(CoreChannel_oid);
CREATE INDEX TypeRepository_Auto_1 ON TypeRepository(Node_oid);
CREATE INDEX FileTypeRecognizer_Auto_1 ON FileTypeRecognizer(TypeRepository_oid);
CREATE INDEX EntityAnalyzer_Auto_1 ON EntityAnalyzer(Repository_oid);
CREATE INDEX EntityAnalyzer_Auto_2 ON EntityAnalyzer(Recognizer_oid);
CREATE INDEX EntityAnalyzer_Manual_lookUpAutoIndex1 ON EntityAnalyzer(ObjectReaderTypeName);
CREATE INDEX EntityAnalyzer_Auto_3 ON EntityAnalyzer(CoreObjectReader_oid);
CREATE INDEX EntityAnalyzer_EntityType_Auto_1 ON EntityAnalyzer_EntityType(EntityAnalyzer_oid);
CREATE INDEX EntityAnalyzer_EntityType_Auto_2 ON EntityAnalyzer_EntityType(EntityType_oid);
CREATE INDEX EntityType_Auto_1 ON EntityType(Repository_oid);
CREATE INDEX EntityType_Manual_EntityTypeName ON EntityType(EntityTypeName);
CREATE INDEX EntityType_Manual_lookUpAutoIndex1 ON EntityType(EntityTypeName);
CREATE INDEX EntityType_Auto_2 ON EntityType(DefaultContainerizer_oid);
CREATE INDEX EntityType_Auto_3 ON EntityType(DefaultObjectWriter_oid);
CREATE INDEX EntityType_Auto_4 ON EntityType(DefaultObjectReader_oid);
CREATE INDEX EntityContainerizer_Auto_1 ON EntityContainerizer(Repository_oid);
CREATE INDEX EntityContainerizer_Manual_lookUpAutoIndex1 ON EntityContainerizer(ContainerizerTypeName);
CREATE INDEX EntityContainerizer_Auto_2 ON EntityContainerizer(CoreObjectWriter_oid);
CREATE INDEX TypeSet_Auto_1 ON TypeSet(Partner_oid);
CREATE INDEX TypeSet_Auto_2 ON TypeSet(Type_oid);
CREATE INDEX TypeSet_Auto_3 ON TypeSet(TargetType_oid);
CREATE INDEX TypeSet_Auto_4 ON TypeSet(CoreChannel_oid);
CREATE INDEX TypeSet_Auto_5 ON TypeSet(EntityContainerizer_oid);
CREATE INDEX TypeSet_Auto_6 ON TypeSet(Mapping_oid);
CREATE INDEX HttpSendChannel_Auto_1 ON HttpSendChannel(CoreChannel_oid);
CREATE INDEX ediBOXReceiveChannel_Auto_1 ON ediBOXReceiveChannel(CoreChannel_oid);
CREATE INDEX ediBOXSendChannel_Auto_1 ON ediBOXSendChannel(CoreChannel_oid);
CREATE INDEX FileEventListener_Auto_1 ON FileEventListener(CoreEventListener_oid);
CREATE INDEX Pop3ReceiveChannel_Auto_1 ON Pop3ReceiveChannel(CoreChannel_oid);
CREATE INDEX CoreObjectReader_Auto_1 ON CoreObjectReader(Repository_oid);
CREATE INDEX EdifactReaderConfig_Auto_1 ON EdifactReaderConfig(CoreObjectReader_oid);
CREATE INDEX SdfReaderConfig_Auto_1 ON SdfReaderConfig(CoreObjectReader_oid);
CREATE INDEX HarddiskSendChannel_Auto_1 ON HarddiskSendChannel(CoreChannel_oid);
CREATE INDEX HarddiskReceiveChannel_Auto_1 ON HarddiskReceiveChannel(CoreChannel_oid);
CREATE INDEX SmtpSendChannel_Auto_1 ON SmtpSendChannel(CoreChannel_oid);
CREATE INDEX FixedLengthReaderConfig_Auto_1 ON FixedLengthReaderConfig(CoreObjectReader_oid);
CREATE INDEX XmlReaderConfig_Auto_1 ON XmlReaderConfig(CoreObjectReader_oid);
CREATE INDEX CoreObjectWriter_Auto_1 ON CoreObjectWriter(Repository_oid);
CREATE INDEX EdifactWriterConfig_Auto_1 ON EdifactWriterConfig(CoreObjectWriter_oid);
CREATE INDEX SdfWriterConfig_Auto_1 ON SdfWriterConfig(CoreObjectWriter_oid);
CREATE INDEX FixedLengthWriterConfig_Auto_1 ON FixedLengthWriterConfig(CoreObjectWriter_oid);
CREATE INDEX XmlWriterConfig_Auto_1 ON XmlWriterConfig(CoreObjectWriter_oid);
CREATE INDEX SapIDocWriterConfig_Auto_1 ON SapIDocWriterConfig(CoreObjectWriter_oid);
CREATE INDEX SapIDocReaderConfig_Auto_1 ON SapIDocReaderConfig(CoreObjectReader_oid);
CREATE INDEX Location_Auto_1 ON Location(Partner_oid);
CREATE INDEX Location_Auto_2 ON Location(BackendReference_oid);
CREATE INDEX Location_Auto_3 ON Location(Node_oid);
CREATE INDEX LocationLookup_Auto_1 ON LocationLookup(Location_oid);
CREATE INDEX LocationLookup_Auto_2 ON LocationLookup(TableType_oid);
CREATE INDEX LocationLookup_Auto_3 ON LocationLookup(Table_oid);
CREATE INDEX AS2ReceiveChannel_Auto_1 ON AS2ReceiveChannel(CoreChannel_oid);
CREATE INDEX AS2SendChannel_Auto_1 ON AS2SendChannel(CoreChannel_oid);
CREATE INDEX SmtpReceiveChannel_Auto_1 ON SmtpReceiveChannel(CoreChannel_oid);
CREATE INDEX Pop3SendChannel_Auto_1 ON Pop3SendChannel(CoreChannel_oid);
CREATE INDEX ChannelProxyEventListener_Auto_1 ON ChannelProxyEventListener(CoreEventListener_oid);
CREATE INDEX FtpSendChannel_Auto_1 ON FtpSendChannel(CoreChannel_oid);
CREATE INDEX FtpReceiveChannel_Auto_1 ON FtpReceiveChannel(CoreChannel_oid);
CREATE INDEX ArticleAttribute_Auto_1 ON ArticleAttribute(Location_oid);
CREATE INDEX CounterDef_Auto_1 ON CounterDef(Node_oid);
CREATE INDEX CounterDef_Manual_lookUpAutoIndex1 ON CounterDef(Name);
CREATE INDEX CounterValue_Auto_1 ON CounterValue(CounterDef_oid);
CREATE INDEX AnsiX12ReaderConfig_Auto_1 ON AnsiX12ReaderConfig(CoreObjectReader_oid);
CREATE INDEX AnsiX12WriterConfig_Auto_1 ON AnsiX12WriterConfig(CoreObjectWriter_oid);
CREATE INDEX XmlReaderExConfig_Auto_1 ON XmlReaderExConfig(CoreObjectReader_oid);
CREATE INDEX ShoeTransactionSendChannel_Auto_1 ON ShoeTransactionSendChannel(CoreChannel_oid);
CREATE INDEX ShoeTransactionResponseChannel_Auto_1 ON ShoeTransactionResponseChannel(CoreChannel_oid);
CREATE INDEX ediBoxInhouseReaderConfig_Auto_1 ON ediBoxInhouseReaderConfig(CoreObjectReader_oid);
CREATE INDEX ediBoxInhouseWriterConfig_Auto_1 ON ediBoxInhouseWriterConfig(CoreObjectWriter_oid);
CREATE INDEX VariableDefinition_Auto_1 ON VariableDefinition(Node_oid);
CREATE INDEX VariableDefinition_Auto_2 ON VariableDefinition(LookupTableValueProvider_oid);
CREATE INDEX VariableInstance_Auto_1 ON VariableInstance(VariableDefinition_oid);
CREATE INDEX VariableInstance_Auto_2 ON VariableInstance(Location_oid);
CREATE INDEX ArticlePool_Auto_1 ON ArticlePool(Location_oid);
CREATE INDEX ArticlePool_Auto_2 ON ArticlePool(Article_oid);
CREATE INDEX ArticlePool_Auto_3 ON ArticlePool(Node_oid);
CREATE INDEX ArticleEAN_Auto_1 ON ArticleEAN(ArticleDetail_oid);
CREATE INDEX X400SendChannel_Auto_1 ON X400SendChannel(CoreChannel_oid);
CREATE INDEX X400ReceiveChannel_Auto_1 ON X400ReceiveChannel(CoreChannel_oid);
