Sql Script up to date?

Topics: Developer Forum, Project Management Forum
Jan 13, 2009 at 11:07 AM
On the generate install script during the installation it produces the following sql script:
create table n2AllowedRole (
  ID  integer,
   ItemID INTEGER not null,
   Role TEXT not null,
   primary key (ID)
)
create table n2Detail (
  ID  integer,
   Type TEXT not null,
   ItemID INTEGER not null,
   DetailCollectionID INTEGER,
   Name TEXT,
   BoolValue INTEGER,
   IntValue INTEGER,
   LinkValue INTEGER,
   DoubleValue NUMERIC,
   DateTimeValue DATETIME,
   StringValue TEXT,
   Value BLOB,
   primary key (ID)
)
create table n2Item (
  ID  integer,
   Type TEXT not null,
   Created DATETIME not null,
   Published DATETIME,
   Updated DATETIME not null,
   Expires DATETIME,
   Name TEXT,
   ZoneName TEXT,
   Title TEXT,
   SortOrder INTEGER not null,
   Visible INTEGER not null,
   SavedBy TEXT,
   VersionOfID INTEGER,
   ParentID INTEGER,
   primary key (ID)
)
create table n2DetailCollection (
  ID  integer,
   ItemID INTEGER,
   Name TEXT not null,
   primary key (ID)
)

where as the example uses
CREATE TABLE [dbo].[n2AllowedRole](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [ItemID] [int] NOT NULL,
    [Role] [nvarchar](50) NOT NULL,

CREATE TABLE [dbo].[n2Detail](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Type] [nvarchar](255) NOT NULL,
    [ItemID] [int] NOT NULL,
    [DetailCollectionID] [int] NULL,
    [Name] [nvarchar](50) NULL,
    [BoolValue] [bit] NULL,
    [IntValue] [int] NULL,
    [LinkValue] [int] NULL,
    [DoubleValue] [float] NULL,
    [DateTimeValue] [datetime] NULL,
    [StringValue] [nvarchar](max) NULL,
    [Value] [varbinary](max) NULL,


CREATE TABLE [dbo].[n2Item](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Type] [nvarchar](255) NOT NULL,
    [Updated] [datetime] NOT NULL,
    [Name] [nvarchar](255) NULL,
    [ZoneName] [nvarchar](50) NULL,
    [Title] [nvarchar](255) NULL,
    [Created] [datetime] NOT NULL,
    [Published] [datetime] NULL,
    [Expires] [datetime] NULL,
    [SortOrder] [int] NOT NULL,
    [Visible] [bit] NOT NULL,
    [SavedBy] [nvarchar](50) NULL,
    [VersionOfID] [int] NULL,
    [ParentID] [int] NULL,

CREATE TABLE [dbo].[n2DetailCollection](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [ItemID] [int] NULL,
    [Name] [nvarchar](50) NOT NULL,

this one looks newer, should/can the script be updated in the CSharp example?
[varbinary](max) will be faster than Blobs.

Jan 13, 2009 at 11:11 AM
For the latest scripts visit

http://n2cms.com/Documentation/The%20database.aspx
Coordinator
Jan 14, 2009 at 6:21 PM
Those scripts are generated from a tool for a certain database. What database type do you have configured. The script could be for sql server 2000.