Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
8
Indexable
Never
CREATE TABLE [dbo].[REFCategory](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [nvarchar](250) NOT NULL,
	[isDeleted] [bit] NOT NULL,
 CONSTRAINT [PK_REFCategory] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[CNContent](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[title] [nvarchar](250) NOT NULL,
	[description] [nvarchar](MAX) NOT NULL,
	[photoUrl] [nvarchar](250),
	[linkUrl] [nvarchar](250),
	[pdfUrl] [nvarchar](250),
	[categoryId] [int] NOT NULL,
	[isActive] [bit] NOT NULL,
	[isDeleted] [bit] NOT NULL,
	[createdDate] [datetime] NOT NULL,
	[createdUserId] [int] NOT NULL,
	[updatedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_CNContent] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE CNContent
ADD FOREIGN KEY (categoryId) REFERENCES REFCategory(id);