USE [jintemples]
GO
/****** Object: Table [dbo].[DBBhojanShala] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBBhojanShala](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[TrustId] [int] NULL,
[ContactDetailId] [int] NULL,
[NavkarshiTime] [nvarchar](50) NULL,
[LunchTime] [nvarchar](50) NULL,
[HighTeaTime] [nvarchar](50) NULL,
[DinnerTime] [nvarchar](50) NULL,
CONSTRAINT [PK_DBBhojanShala] 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
/****** Object: Table [dbo].[DBCity] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBCity](
[Id] [int] NOT NULL,
[Name] [nvarchar](50) NULL,
[State] [nvarchar](50) NULL,
[Country] [nvarchar](50) NULL,
[Latitude] [nvarchar](50) NULL,
[Longitude] [nvarchar](50) NULL,
CONSTRAINT [PK_DBCity] 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
/****** Object: Table [dbo].[DBContactDetails] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBContactDetails](
[Id] [int] NOT NULL,
[Address1] [nvarchar](50) NULL,
[Address2] [nvarchar](50) NULL,
[ContactNumber1] [nvarchar](50) NULL,
[ContactNumber2] [nvarchar](50) NULL,
[EmailAddress] [nvarchar](50) NULL,
[ContactPerson] [nvarchar](50) NULL,
[Website] [nvarchar](50) NULL,
CONSTRAINT [PK_DBContactDetails] 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
/****** Object: Table [dbo].[DBDataRequest] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBDataRequest](
[Id] [int] NOT NULL,
[RequestEntity] [int] NULL,
[RequestedJson] [nvarchar](max) NULL,
[Status] [int] NULL,
[Field] [nvarchar](50) NULL,
[Value] [nvarchar](50) NULL,
[RequestedBy] [nvarchar](50) NULL,
[RequestedDate] [datetime] NULL,
[ApprovedBy] [nvarchar](50) NULL,
[ApprovedDate] [datetime] NULL,
CONSTRAINT [PK_DBDataRequest] 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] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[DBDataUpdates] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBDataUpdates](
[Id] [int] NOT NULL,
[UpdatedOn] [datetime] NULL,
[UpdatedBy] [int] NULL,
[Status] [int] NULL,
[PointTransactionId] [int] NULL,
[UpdatedEntityPrimaryId] [int] NULL,
[UpdatedField] [nvarchar](50) NULL,
[UpdatedFieldValue] [nvarchar](max) NULL,
[ReviewedBy] [int] NULL,
[ReviewedOn] [int] NULL,
[ReviewerComment] [nvarchar](255) NULL,
CONSTRAINT [PK_DBDataUpdates] 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] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[DBDharmshala] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBDharmshala](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[TrustId] [int] NULL,
[ContactDetailId] [int] NULL,
[CheckInTime] [nvarchar](50) NULL,
CONSTRAINT [PK_DBDharmshala] 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
/****** Object: Table [dbo].[DBENumChild] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBENumChild](
[Id] [int] NOT NULL,
[EnumMasterId] [int] NULL,
[Value] [int] NULL,
[Title] [nvarchar](50) NULL,
[Description] [nvarchar](max) NULL,
CONSTRAINT [PK_DBENumChild] 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] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[DBEnumMaster] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBEnumMaster](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[IsActive] [bit] NULL,
CONSTRAINT [PK_DBEnumMaster] 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
/****** Object: Table [dbo].[DBIdolMaster] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBIdolMaster](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[IdolTypeId] [int] NULL,
[PanchKalyanak] [nvarchar](50) NULL,
[KevalgyanOn] [nvarchar](50) NULL,
CONSTRAINT [PK_DBIdolMaster] 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
/****** Object: Table [dbo].[DBIdolMasterTempleMapping] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBIdolMasterTempleMapping](
[Id] [int] NOT NULL,
[TempleId] [int] NULL,
[IdolId] [int] NULL,
[IsMoolnayak] [int] NULL,
[Image] [nvarchar](255) NULL,
CONSTRAINT [PK_DBIdolMasterTempleMapping] 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
/****** Object: Table [dbo].[DBIdolType] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBIdolType](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
CONSTRAINT [PK_DBIdolType] 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
/****** Object: Table [dbo].[DBImageMapping] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBImageMapping](
[Id] [int] NOT NULL,
[Image] [nvarchar](255) NULL,
[ImageType] [nvarchar](50) NULL,
[SequenceOrder] [int] NULL,
CONSTRAINT [PK_DBImageMapping] 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
/****** Object: Table [dbo].[DBMaharaj] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBMaharaj](
[Id] [int] NOT NULL,
[Name] [nvarchar](50) NULL,
[Gender] [int] NULL,
[Thana] [nvarchar](50) NULL,
[DikshaDate] [nvarchar](50) NULL,
[Designation] [nvarchar](50) NULL,
CONSTRAINT [PK_DBMaharaj] 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
/****** Object: Table [dbo].[DBMembers] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBMembers](
[Id] [int] NOT NULL,
[FirstName] [nvarchar](50) NULL,
[MiddleName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[ContactDetailsId] [int] NULL,
CONSTRAINT [PK_DBMembers] 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
/****** Object: Table [dbo].[DBPointsDistribution] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBPointsDistribution](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[Description] [nvarchar](255) NULL,
[Points] [decimal](18, 2) NULL,
CONSTRAINT [PK_DBPointsDistribution] 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
/****** Object: Table [dbo].[DBPointTransaction] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBPointTransaction](
[Id] [int] NOT NULL,
[PointsEarned] [decimal](18, 2) NULL,
[TransactionTime] [datetime] NULL,
[TransactionNote] [nvarchar](255) NULL,
[Status] [int] NULL,
[UserId] [int] NULL,
CONSTRAINT [PK_DBPointTransaction] 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
/****** Object: Table [dbo].[DBReferrals] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBReferrals](
[Id] [int] NOT NULL,
[UserId] [nvarchar](255) NULL,
[ReferralUserId] [nvarchar](255) NULL,
[Status] [int] NULL,
CONSTRAINT [PK_DBReferrals] 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
/****** Object: Table [dbo].[DBTemple] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBTemple](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[BriefDescription] [nvarchar](255) NULL,
[ContactDetailId] [int] NULL,
[TrustId] [int] NULL,
[CityId] [int] NULL,
[TempleTypeId] [int] NULL,
[EstablishmentYear] [nvarchar](50) NULL,
[EstablishBy] [nvarchar](255) NULL,
CONSTRAINT [PK_DBTemple] 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
/****** Object: Table [dbo].[DBTempleImageMapping] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBTempleImageMapping](
[Id] [int] NOT NULL,
[TempleId] [int] NULL,
[Image] [nvarchar](255) NULL,
[SequenceOrder] [int] NULL,
CONSTRAINT [PK_DBTempleImageMapping] 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
/****** Object: Table [dbo].[DBTrust] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBTrust](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[ContactDetailsId] [int] NULL,
CONSTRAINT [PK_DBTrust] 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
/****** Object: Table [dbo].[DBTrustCommittee] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBTrustCommittee](
[Id] [int] NOT NULL,
[TrustId] [int] NULL,
[Designation] [nvarchar](50) NULL,
[IsActive] [int] NULL,
CONSTRAINT [PK_DBTrustCommittee] 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
/****** Object: Table [dbo].[DBUpasara] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBUpasara](
[Id] [int] NOT NULL,
[Title] [nvarchar](50) NULL,
[TrustId] [int] NULL,
[ContactDetailId] [int] NULL,
[IsTemp] [int] NULL,
CONSTRAINT [PK_DBUpasara] 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
/****** Object: Table [dbo].[DBUpasaraMaharajMapping] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBUpasaraMaharajMapping](
[Id] [int] NOT NULL,
[FromDate] [datetime] NULL,
[ToDate] [datetime] NULL,
[MaharajId] [int] NULL,
[UpasaraId] [int] NULL,
CONSTRAINT [PK_DBUpasaraMaharajMapping] 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
/****** Object: Table [dbo].[DBUserComments] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBUserComments](
[Id] [int] NOT NULL,
[ReferenceTypeId] [int] NULL,
[ReferenceTypePrimaryId] [int] NULL,
[CommentUserId] [int] NULL,
[Comments] [nvarchar](255) NULL,
[CommentBy] [int] NULL,
[CommentType] [int] NULL,
[CommentedOn] [datetime] NULL,
[Status] [int] NULL,
CONSTRAINT [PK_DBUserComments] 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
/****** Object: Table [dbo].[DBUsers] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBUsers](
[Id] [int] NOT NULL,
[FirstName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[MiddleName] [nvarchar](50) NULL,
[Email] [nvarchar](250) NULL,
[Password] [nvarchar](50) NULL,
[ReferralKey] [nvarchar](50) NULL,
[RegistrationDate] [datetime] NULL,
[ActivationDate] [datetime] NULL,
[Status] [int] NULL,
[MobileNumber] [nvarchar](50) NULL,
[WhatsAppNumber] [nvarchar](50) NULL,
[ContributionLevel] [nvarchar](50) NULL,
CONSTRAINT [PK_DBUsers] 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
/****** Object: Table [dbo].[DBUserTrustMapping] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBUserTrustMapping](
[Id] [int] NOT NULL,
[TrustId] [int] NULL,
[UserId] [int] NULL,
CONSTRAINT [PK_DBUserTrustMapping] 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].[DBBhojanShala] WITH CHECK ADD CONSTRAINT [FK_DBBhojanShala_DBContactDetails] FOREIGN KEY([ContactDetailId])
REFERENCES [dbo].[DBContactDetails] ([Id])
GO
ALTER TABLE [dbo].[DBBhojanShala] CHECK CONSTRAINT [FK_DBBhojanShala_DBContactDetails]
GO
ALTER TABLE [dbo].[DBBhojanShala] WITH CHECK ADD CONSTRAINT [FK_DBBhojanShala_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBBhojanShala] CHECK CONSTRAINT [FK_DBBhojanShala_DBTrust]
GO
ALTER TABLE [dbo].[DBDharmshala] WITH CHECK ADD CONSTRAINT [FK_DBDharmshala_DBContactDetails] FOREIGN KEY([ContactDetailId])
REFERENCES [dbo].[DBContactDetails] ([Id])
GO
ALTER TABLE [dbo].[DBDharmshala] CHECK CONSTRAINT [FK_DBDharmshala_DBContactDetails]
GO
ALTER TABLE [dbo].[DBDharmshala] WITH CHECK ADD CONSTRAINT [FK_DBDharmshala_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBDharmshala] CHECK CONSTRAINT [FK_DBDharmshala_DBTrust]
GO
ALTER TABLE [dbo].[DBTemple] WITH CHECK ADD CONSTRAINT [FK_DBTemple_DBCity] FOREIGN KEY([CityId])
REFERENCES [dbo].[DBCity] ([Id])
GO
ALTER TABLE [dbo].[DBTemple] CHECK CONSTRAINT [FK_DBTemple_DBCity]
GO
ALTER TABLE [dbo].[DBTemple] WITH CHECK ADD CONSTRAINT [FK_DBTemple_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBTemple] CHECK CONSTRAINT [FK_DBTemple_DBTrust]
GO
ALTER TABLE [dbo].[DBTemple] WITH CHECK ADD CONSTRAINT [FK_DBTemple_DBUsers] FOREIGN KEY([CityId])
REFERENCES [dbo].[DBUsers] ([Id])
GO
ALTER TABLE [dbo].[DBTemple] CHECK CONSTRAINT [FK_DBTemple_DBUsers]
GO
ALTER TABLE [dbo].[DBTrustCommittee] WITH CHECK ADD CONSTRAINT [FK_DBTrustCommittee_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBTrustCommittee] CHECK CONSTRAINT [FK_DBTrustCommittee_DBTrust]
GO
ALTER TABLE [dbo].[DBUpasara] WITH CHECK ADD CONSTRAINT [FK_DBUpasara_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBUpasara] CHECK CONSTRAINT [FK_DBUpasara_DBTrust]
GO
ALTER TABLE [dbo].[DBUpasaraMaharajMapping] WITH CHECK ADD CONSTRAINT [FK_DBUpasaraMaharajMapping_DBMaharaj] FOREIGN KEY([MaharajId])
REFERENCES [dbo].[DBMaharaj] ([Id])
GO
ALTER TABLE [dbo].[DBUpasaraMaharajMapping] CHECK CONSTRAINT [FK_DBUpasaraMaharajMapping_DBMaharaj]
GO
ALTER TABLE [dbo].[DBUpasaraMaharajMapping] WITH CHECK ADD CONSTRAINT [FK_DBUpasaraMaharajMapping_DBUpasara] FOREIGN KEY([UpasaraId])
REFERENCES [dbo].[DBUpasara] ([Id])
GO
ALTER TABLE [dbo].[DBUpasaraMaharajMapping] CHECK CONSTRAINT [FK_DBUpasaraMaharajMapping_DBUpasara]
GO
ALTER TABLE [dbo].[DBUserComments] WITH CHECK ADD CONSTRAINT [FK_DBUserComments_DBReferrals] FOREIGN KEY([CommentUserId])
REFERENCES [dbo].[DBReferrals] ([Id])
GO
ALTER TABLE [dbo].[DBUserComments] CHECK CONSTRAINT [FK_DBUserComments_DBReferrals]
GO
ALTER TABLE [dbo].[DBUserComments] WITH CHECK ADD CONSTRAINT [FK_DBUserComments_DBReferrals1] FOREIGN KEY([CommentBy])
REFERENCES [dbo].[DBReferrals] ([Id])
GO
ALTER TABLE [dbo].[DBUserComments] CHECK CONSTRAINT [FK_DBUserComments_DBReferrals1]
GO
ALTER TABLE [dbo].[DBUserTrustMapping] WITH CHECK ADD CONSTRAINT [FK_DBUserTrustMapping_DBTrust] FOREIGN KEY([TrustId])
REFERENCES [dbo].[DBTrust] ([Id])
GO
ALTER TABLE [dbo].[DBUserTrustMapping] CHECK CONSTRAINT [FK_DBUserTrustMapping_DBTrust]
GO
/****** Object: StoredProcedure [dbo].[CheckLogin] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[CheckLogin]
@Email nvarchar(250),
@Password nvarchar(50)
as
begin
select * from DBUsers where Email = @Email and Password = @Password
end
GO
/****** Object: StoredProcedure [dbo].[GetMyPoints] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetMyPoints]
@UserId int
AS
begin
select * from DBPointTransaction where UserId = @UserId
end
GO
/****** Object: StoredProcedure [dbo].[GetMyReferrals] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[GetMyReferrals]
@Id int
AS
begin
select b.FirstName, b.LastName, b.ActivationDate from DBReferrals
--left join DBUsers a on DBReferrals.UserId = a.Id
left join DBUsers b on DBReferrals.ReferralUserId = b.Id
where DBReferrals.UserId = @Id and DBReferrals.Status = 1
end
GO
/****** Object: StoredProcedure [dbo].[GetMySubmissions] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetMySubmissions]
@Id int
AS
begin
select 'To be implement'
end
GO
/****** Object: StoredProcedure [dbo].[GetReferralCode] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetReferralCode]
@Id int
AS
begin
select ReferralKey from DBUsers where Id = @Id
end
GO
/****** Object: StoredProcedure [dbo].[GetTempleByTempleId] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetTempleByTempleId]
@TempleId int
as
begin
select * from DBTemple where Id = @TempleId
end
GO
/****** Object: StoredProcedure [dbo].[GetTemplesByCity] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetTemplesByCity]
@CityId int
as
begin
select * from DBTemple where CityId = @CityId
end
GO
/****** Object: StoredProcedure [dbo].[GetTemplesByTrust] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[GetTemplesByTrust]
@TrustId int
as
begin
select * from DBTemple where TrustId = @TrustId
end
GO
/****** Object: StoredProcedure [dbo].[Register] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create procedure [dbo].[Register]
@FirstName nvarchar(50),
@LastName nvarchar(50),
@Email nvarchar(250),
@Password nvarchar(50),
@ReferralKey nvarchar(50),
@MobileNumber nvarchar(50)
as
begin
select * from DBUsers where Email = @Email and Password = @Password
insert into DBUsers (FirstName, LastName, Email, Password, ReferralKey, RegistrationDate, Status, MobileNumber, WhatsAppNumber, ContributionLevel)
Values (@FirstName, @LastName, @Email, @Password, @ReferralKey, GETUTCDATE(), 1, @MobileNumber, @MobileNumber, 'BRONZE')
end
GO
/****** Object: StoredProcedure [dbo].[UpdatePassword] Script Date: 27-08-2021 02:25:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create procedure [dbo].[UpdatePassword]
@Email nvarchar(250),
@OldPassword nvarchar(50),
@NewPassword nvarchar(50)
as
begin
Update DBUsers set Password = @NewPassword where Email = @Email and Password = @OldPassword
end
GO