-- Table: owned_visual_element
CREATE TABLE [owned_visual_element] (
    [gobject_id] int NOT NULL,
    [package_id] int NOT NULL,
    [mx_primitive_id] smallint NOT NULL,
    [visual_element_id] int NOT NULL,
    [thumbnail] image(2147483647) NULL,
    [description] nvarchar(1024) NULL,
    [visual_element_definition] image(2147483647) NOT NULL,
    [is_thumbnail_dirty] bit NOT NULL DEFAULT ((0)),
    [visual_element_definition_grm] image(2147483647) NOT NULL,
    [content_type] nvarchar(1024) NULL,
    [visual_element_crossRef] nvarchar(-1) NULL,
    [preview] image(2147483647) NULL,
    CONSTRAINT [PK_owned_visual_element] PRIMARY KEY ([gobject_id], [package_id], [mx_primitive_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id], [gobject_id], [mx_primitive_id], [package_id])
);
GO

ALTER TABLE [owned_visual_element] ADD FOREIGN KEY ([package_id]) REFERENCES [visual_element_version] ([package_id]);
GO

