-- Table: package
CREATE TABLE [package] (
    [gobject_id] int NOT NULL,
    [package_id] int NOT NULL,
    [status_id] int NOT NULL DEFAULT ((0)),
    [reference_status_id] int NOT NULL DEFAULT ((0)),
    [instance_attributes] image(2147483647) NULL,
    [operation_status] int NOT NULL DEFAULT ((0)),
    [security_group] nvarchar(32) NOT NULL DEFAULT ('Default'),
    [derived_from_package_id] int NOT NULL DEFAULT ((0)),
    [deployable_configuration_version] int NOT NULL DEFAULT ((0)),
    [package_type] nvarchar(5) NOT NULL DEFAULT ('I'),
    [package_version] smallint NOT NULL DEFAULT ((0)),
    [object_status] smallint NOT NULL DEFAULT ((0)),
    CONSTRAINT [PK_package] PRIMARY KEY ([gobject_id], [package_id], [gobject_id], [status_id])
);
GO

ALTER TABLE [package] ADD FOREIGN KEY ([status_id]) REFERENCES [lookup_status] ([status_id]);
GO

