Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [dbaebd839dbef34423b846a9ae01344d36]
- GO
- /****** Object: Table [dbo].[Parks] Script Date: 14/12/2018 15:46:30 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- CREATE TABLE [dbo].[Parks](
- [Id] [nvarchar](50) NOT NULL,
- [Description] [nvarchar](150) NULL,
- [NumberOfSpots] [int] NOT NULL,
- [OperatingHours] [nvarchar](50) NULL,
- [NumberOfSpecialSpots] [int] NOT NULL,
- CONSTRAINT [PK_Parks] 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].[Sensors](
- [Id] [int] IDENTITY(1,1) NOT NULL,
- [SensorId] [nvarchar](50) NOT NULL,
- [ParkId] [nvarchar](50) NOT NULL,
- [Type] [nvarchar](25) NULL,
- [LastUpdated] [datetime] NOT NULL,
- [SpotStatus] [bit] NOT NULL,
- [BatteryStatus] [bit] NOT NULL,
- [Location] [nvarchar](50) NOT NULL,
- CONSTRAINT [PK_Sensors] 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 [dbo].[Sensors] WITH CHECK ADD CONSTRAINT [FK_Sensors_Parks] FOREIGN KEY([ParkId])
- REFERENCES [dbo].[Parks] ([Id])
- GO
- ALTER TABLE [dbo].[Sensors] CHECK CONSTRAINT [FK_Sensors_Parks]
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement