Y2S1-Database_Design/SQL/individual_creates/14 - MediaEntry.Table.sql
2020-06-07 22:29:59 +01:00

32 lines
2.0 KiB
Transact-SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

USE [MediaLibrary]
GO
/****** Object: Table [dbo].[MediaEntry] Script Date: 14/12/2018 00:20:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MediaEntry](
[EntryID] [int] IDENTITY(1,1) NOT NULL,
[CategoryID] [int] NOT NULL,
[UserID] [int] NOT NULL,
[ProductionID] [int] NULL,
[Title] [varchar](255) NOT NULL,
[EntryDescription] [text] NULL,
[UploadDate] [datetime] NOT NULL,
[Premium] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[EntryID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[MediaEntry] WITH CHECK ADD FOREIGN KEY([CategoryID])
REFERENCES [dbo].[Category] ([CategoryID])
GO
ALTER TABLE [dbo].[MediaEntry] WITH CHECK ADD FOREIGN KEY([ProductionID])
REFERENCES [dbo].[Production] ([ProductionID])
GO
ALTER TABLE [dbo].[MediaEntry] WITH CHECK ADD FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
GO