USE [VVVDR1]
GO
/****** Object:  Table [dbo].[vvvDetection]    Script Date: 07/01/2013 12:10:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[vvvDetection](
	[multiframeID] [bigint] NOT NULL,
	[extNum] [tinyint] NOT NULL,
	[cuEventID] [int] NOT NULL,
	[seqNum] [int] NOT NULL,
	[filterID] [tinyint] NOT NULL,
	[isoFlux] [real] NOT NULL,
	[isoMag] [real] NOT NULL,
	[x] [real] NOT NULL,
	[xErr] [real] NOT NULL,
	[y] [real] NOT NULL,
	[yErr] [real] NOT NULL,
	[gauSig] [real] NOT NULL,
	[ell] [real] NOT NULL,
	[pa] [real] NOT NULL,
	[aProf1] [real] NOT NULL,
	[aProf2] [int] NOT NULL,
	[aProf3] [int] NOT NULL,
	[aProf4] [int] NOT NULL,
	[aProf5] [int] NOT NULL,
	[aProf6] [int] NOT NULL,
	[aProf7] [int] NOT NULL,
	[aProf8] [int] NOT NULL,
	[pHeight] [real] NOT NULL,
	[pHeightErr] [real] NOT NULL,
	[aperFlux1] [real] NOT NULL,
	[aperFlux1err] [real] NOT NULL,
	[aperMagNoAperCorr1] [real] NOT NULL,
	[aperMag1] [real] NOT NULL,
	[aperMag1err] [real] NOT NULL,
	[aperFlux2] [real] NOT NULL,
	[aperFlux2err] [real] NOT NULL,
	[aperMagNoAperCorr2] [real] NOT NULL,
	[aperMag2] [real] NOT NULL,
	[aperMag2err] [real] NOT NULL,
	[aperFlux3] [real] NOT NULL,
	[aperFlux3err] [real] NOT NULL,
	[aperMagNoAperCorr3] [real] NOT NULL,
	[aperMag3] [real] NOT NULL,
	[aperMag3err] [real] NOT NULL,
	[aperFlux4] [real] NOT NULL,
	[aperFlux4err] [real] NOT NULL,
	[aperMagNoAperCorr4] [real] NOT NULL,
	[aperMag4] [real] NOT NULL,
	[aperMag4err] [real] NOT NULL,
	[aperFlux5] [real] NOT NULL,
	[aperFlux5err] [real] NOT NULL,
	[aperMagNoAperCorr5] [real] NOT NULL,
	[aperMag5] [real] NOT NULL,
	[aperMag5err] [real] NOT NULL,
	[aperFlux6] [real] NOT NULL,
	[aperFlux6err] [real] NOT NULL,
	[aperMagNoAperCorr6] [real] NOT NULL,
	[aperMag6] [real] NOT NULL,
	[aperMag6err] [real] NOT NULL,
	[aperFlux7] [real] NOT NULL,
	[aperFlux7err] [real] NOT NULL,
	[aperMagNoAperCorr7] [real] NOT NULL,
	[aperMag7] [real] NOT NULL,
	[aperMag7err] [real] NOT NULL,
	[aperFlux8] [real] NOT NULL,
	[aperFlux8err] [real] NOT NULL,
	[aperMag8] [real] NOT NULL,
	[aperMag8err] [real] NOT NULL,
	[aperFlux9] [real] NOT NULL,
	[aperFlux9err] [real] NOT NULL,
	[aperMag9] [real] NOT NULL,
	[aperMag9err] [real] NOT NULL,
	[aperFlux10] [real] NOT NULL,
	[aperFlux10err] [real] NOT NULL,
	[aperMag10] [real] NOT NULL,
	[aperMag10err] [real] NOT NULL,
	[aperFlux11] [real] NOT NULL,
	[aperFlux11err] [real] NOT NULL,
	[aperMag11] [real] NOT NULL,
	[aperMag11err] [real] NOT NULL,
	[aperFlux12] [real] NOT NULL,
	[aperFlux12err] [real] NOT NULL,
	[aperMag12] [real] NOT NULL,
	[aperMag12err] [real] NOT NULL,
	[aperFlux13] [real] NOT NULL,
	[aperFlux13err] [real] NOT NULL,
	[aperMag13] [real] NOT NULL,
	[aperMag13err] [real] NOT NULL,
	[petroRad] [real] NOT NULL,
	[kronRad] [real] NOT NULL,
	[halfRad] [real] NOT NULL,
	[petroFlux] [real] NOT NULL,
	[petroFluxErr] [real] NOT NULL,
	[petroMag] [real] NOT NULL,
	[petroMagErr] [real] NOT NULL,
	[kronFlux] [real] NOT NULL,
	[kronFluxErr] [real] NOT NULL,
	[kronMag] [real] NOT NULL,
	[kronMagErr] [real] NOT NULL,
	[halfFlux] [real] NOT NULL,
	[halfFluxErr] [real] NOT NULL,
	[halfMag] [real] NOT NULL,
	[halfMagErr] [real] NOT NULL,
	[errBits] [int] NOT NULL,
	[sky] [real] NOT NULL,
	[skyVar] [real] NOT NULL,
	[averageConf] [real] NOT NULL,
	[mjd] [float] NOT NULL,
	[ra] [float] NOT NULL,
	[dec] [float] NOT NULL,
	[cx] [float] NOT NULL,
	[cy] [float] NOT NULL,
	[cz] [float] NOT NULL,
	[htmID] [bigint] NOT NULL,
	[l] [float] NOT NULL,
	[b] [float] NOT NULL,
	[lambda] [float] NOT NULL,
	[eta] [float] NOT NULL,
	[class] [smallint] NOT NULL,
	[classStat] [real] NOT NULL,
	[psfFlux] [real] NOT NULL,
	[psfFluxErr] [real] NOT NULL,
	[psfMag] [real] NOT NULL,
	[psfMagErr] [real] NOT NULL,
	[psfFitX] [real] NOT NULL,
	[psfFitXerr] [real] NOT NULL,
	[psfFitY] [real] NOT NULL,
	[psfFitYerr] [real] NOT NULL,
	[psfFitChi2] [real] NOT NULL,
	[psfFitDof] [smallint] NOT NULL,
	[deltaMag] [real] NOT NULL,
	[illumCorr] [real] NOT NULL,
	[distortCorr] [real] NOT NULL,
	[saturatCorr] [real] NOT NULL,
	[ppErrBits] [int] NOT NULL,
	[deprecated] [tinyint] NOT NULL,
	[objID] [bigint] NOT NULL,
 CONSTRAINT [pk_vvvDetection] PRIMARY KEY CLUSTERED 
(
	[multiframeID] ASC,
	[extNum] ASC,
	[seqNum] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvDetection_FG]
) ON [vvvDetection_FG]
GO
CREATE NONCLUSTERED INDEX [idx_vvvDetection_dec] ON [dbo].[vvvDetection] 
(
	[dec] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvIndices_FG]
GO
CREATE NONCLUSTERED INDEX [idx_vvvDetection_extSeq] ON [dbo].[vvvDetection] 
(
	[extNum] ASC,
	[seqNum] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvIndices_FG]
GO
CREATE NONCLUSTERED INDEX [idx_vvvDetection_htmID] ON [dbo].[vvvDetection] 
(
	[htmID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvIndices_FG]
GO
CREATE NONCLUSTERED INDEX [idx_vvvDetection_objID] ON [dbo].[vvvDetection] 
(
	[objID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvIndices_FG]
GO
CREATE NONCLUSTERED INDEX [idx_vvvDetection_ra] ON [dbo].[vvvDetection] 
(
	[ra] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [vvvIndices_FG]
GO
/****** Object:  Default [DF__vvvDetect__delta__7F60ED59]    Script Date: 07/01/2013 12:10:27 ******/
ALTER TABLE [dbo].[vvvDetection] ADD  DEFAULT ((0.0)) FOR [deltaMag]
GO
/****** Object:  Default [DF__vvvDetect__illum__00551192]    Script Date: 07/01/2013 12:10:27 ******/
ALTER TABLE [dbo].[vvvDetection] ADD  DEFAULT ((0.0)) FOR [illumCorr]
GO
/****** Object:  Default [DF__vvvDetect__disto__014935CB]    Script Date: 07/01/2013 12:10:27 ******/
ALTER TABLE [dbo].[vvvDetection] ADD  DEFAULT ((0.0)) FOR [distortCorr]
GO
/****** Object:  Default [DF__vvvDetect__satur__023D5A04]    Script Date: 07/01/2013 12:10:27 ******/
ALTER TABLE [dbo].[vvvDetection] ADD  DEFAULT ((0.0)) FOR [saturatCorr]
GO
