Skip to content

Commit

Permalink
Move all .sql into folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Boggin committed Jun 14, 2019
1 parent ab34ece commit 0647b8d
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 192 deletions.
62 changes: 31 additions & 31 deletions FeatureRole.sql → sql/FeatureRole.sql
Original file line number Diff line number Diff line change
@@ -1,32 1,32 @@
-- Creating table 'FeatureRole'
CREATE TABLE [dbo].[FeatureRole] (
[Features_Id] int NOT NULL,
[Roles_Id] int NOT NULL
);
GO
-- Creating primary key on [Features_Id], [Roles_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [PK_FeatureRole]
PRIMARY KEY CLUSTERED ([Features_Id], [Roles_Id] ASC);
GO
-- Creating foreign key on [Features_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [FK_FeatureRole_Feature]
FOREIGN KEY ([Features_Id])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Roles_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [FK_FeatureRole_Role]
FOREIGN KEY ([Roles_Id])
REFERENCES [dbo].[Roles]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_FeatureRole_Role'
CREATE INDEX [IX_FK_FeatureRole_Role]
ON [dbo].[FeatureRole]
([Roles_Id]);
-- Creating table 'FeatureRole'
CREATE TABLE [dbo].[FeatureRole] (
[Features_Id] int NOT NULL,
[Roles_Id] int NOT NULL
);
GO
-- Creating primary key on [Features_Id], [Roles_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [PK_FeatureRole]
PRIMARY KEY CLUSTERED ([Features_Id], [Roles_Id] ASC);
GO
-- Creating foreign key on [Features_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [FK_FeatureRole_Feature]
FOREIGN KEY ([Features_Id])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Roles_Id] in table 'FeatureRole'
ALTER TABLE [dbo].[FeatureRole]
ADD CONSTRAINT [FK_FeatureRole_Role]
FOREIGN KEY ([Roles_Id])
REFERENCES [dbo].[Roles]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_FeatureRole_Role'
CREATE INDEX [IX_FK_FeatureRole_Role]
ON [dbo].[FeatureRole]
([Roles_Id]);
GO
24 changes: 12 additions & 12 deletions Features.sql → sql/Features.sql
Original file line number Diff line number Diff line change
@@ -1,12 1,12 @@
-- Creating table 'Features'
CREATE TABLE [dbo].[Features] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL
);
GO
-- Creating primary key on [Id] in table 'Features'
ALTER TABLE [dbo].[Features]
ADD CONSTRAINT [PK_Features]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO
-- Creating table 'Features'
CREATE TABLE [dbo].[Features] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL
);
GO
-- Creating primary key on [Id] in table 'Features'
ALTER TABLE [dbo].[Features]
ADD CONSTRAINT [PK_Features]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO
64 changes: 32 additions & 32 deletions FlagProperties.sql → sql/FlagProperties.sql
Original file line number Diff line number Diff line change
@@ -1,32 1,32 @@
-- Creating table 'FlagProperties'
CREATE TABLE [dbo].[FlagProperties] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL,
[PropertyKey] nvarchar(max) NOT NULL,
[PropertyValue] nvarchar(max) NOT NULL,
[FlagId] int NOT NULL
);
GO

-- Creating primary key on [Id] in table 'FlagProperties'
ALTER TABLE [dbo].[FlagProperties]
ADD CONSTRAINT [PK_FlagProperties]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating foreign key on [FlagId] in table 'FlagProperties'
ALTER TABLE [dbo].[FlagProperties]
ADD CONSTRAINT [FK_FlagToFlagProperty]
FOREIGN KEY ([FlagId])
REFERENCES [dbo].[Flags]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating non-clustered index for FOREIGN KEY 'FK_FlagToFlagProperty'
CREATE INDEX [IX_FK_FlagToFlagProperty]
ON [dbo].[FlagProperties]
([FlagId]);
GO

-- Creating table 'FlagProperties'
CREATE TABLE [dbo].[FlagProperties] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL,
[PropertyKey] nvarchar(max) NOT NULL,
[PropertyValue] nvarchar(max) NOT NULL,
[FlagId] int NOT NULL
);
GO

-- Creating primary key on [Id] in table 'FlagProperties'
ALTER TABLE [dbo].[FlagProperties]
ADD CONSTRAINT [PK_FlagProperties]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating foreign key on [FlagId] in table 'FlagProperties'
ALTER TABLE [dbo].[FlagProperties]
ADD CONSTRAINT [FK_FlagToFlagProperty]
FOREIGN KEY ([FlagId])
REFERENCES [dbo].[Flags]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating non-clustered index for FOREIGN KEY 'FK_FlagToFlagProperty'
CREATE INDEX [IX_FK_FlagToFlagProperty]
ON [dbo].[FlagProperties]
([FlagId]);
GO

58 changes: 29 additions & 29 deletions Flags.sql → sql/Flags.sql
Original file line number Diff line number Diff line change
@@ -1,29 1,29 @@
-- Creating table 'Flags'
CREATE TABLE [dbo].[Flags] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL,
[FeatureId] int NOT NULL
);
GO

-- Creating primary key on [Id] in table 'Flags'
ALTER TABLE [dbo].[Flags]
ADD CONSTRAINT [PK_Flags]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating foreign key on [FeatureId] in table 'Flags'
ALTER TABLE [dbo].[Flags]
ADD CONSTRAINT [FK_FeatureFlag]
FOREIGN KEY ([FeatureId])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating non-clustered index for FOREIGN KEY 'FK_FeatureFlag'
CREATE INDEX [IX_FK_FeatureFlag]
ON [dbo].[Flags]
([FeatureId]);
GO
-- Creating table 'Flags'
CREATE TABLE [dbo].[Flags] (
[Id] int IDENTITY(1,1) NOT NULL,
[Name] nvarchar(max) NOT NULL,
[Description] nvarchar(max) NOT NULL,
[FeatureId] int NOT NULL
);
GO

-- Creating primary key on [Id] in table 'Flags'
ALTER TABLE [dbo].[Flags]
ADD CONSTRAINT [PK_Flags]
PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating foreign key on [FeatureId] in table 'Flags'
ALTER TABLE [dbo].[Flags]
ADD CONSTRAINT [FK_FeatureFlag]
FOREIGN KEY ([FeatureId])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating non-clustered index for FOREIGN KEY 'FK_FeatureFlag'
CREATE INDEX [IX_FK_FeatureFlag]
ON [dbo].[Flags]
([FeatureId]);
GO
30 changes: 15 additions & 15 deletions Roles.sql → sql/Roles.sql
Original file line number Diff line number Diff line change
@@ -1,16 1,16 @@
-- Creating table 'Roles'
CREATE TABLE [dbo].[Roles] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (MAX) NOT NULL,
[Description] NVARCHAR (MAX) NOT NULL,
[LastUpdatedBy] NVARCHAR (50) NOT NULL,
[LastUpdatedAt] DATETIME NOT NULL,
[UpdateVersion] ROWVERSION NULL,
CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
-- Creating primary key on [Id] in table 'Roles'

-- Creating table 'Roles'
CREATE TABLE [dbo].[Roles] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (MAX) NOT NULL,
[Description] NVARCHAR (MAX) NOT NULL,
[LastUpdatedBy] NVARCHAR (50) NOT NULL,
[LastUpdatedAt] DATETIME NOT NULL,
[UpdateVersion] ROWVERSION NULL,
CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
-- Creating primary key on [Id] in table 'Roles'

GO
62 changes: 31 additions & 31 deletions UserFeature.sql → sql/UserFeature.sql
Original file line number Diff line number Diff line change
@@ -1,32 1,32 @@
-- Creating table 'UserFeature'
CREATE TABLE [dbo].[UserFeature] (
[Users_Id] int NOT NULL,
[Features_Id] int NOT NULL
);
GO
-- Creating primary key on [Users_Id], [Features_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [PK_UserFeature]
PRIMARY KEY CLUSTERED ([Users_Id], [Features_Id] ASC);
GO
-- Creating foreign key on [Users_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [FK_UserFeature_User]
FOREIGN KEY ([Users_Id])
REFERENCES [dbo].[Users]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Features_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [FK_UserFeature_Feature]
FOREIGN KEY ([Features_Id])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_UserFeature_Feature'
CREATE INDEX [IX_FK_UserFeature_Feature]
ON [dbo].[UserFeature]
([Features_Id]);
-- Creating table 'UserFeature'
CREATE TABLE [dbo].[UserFeature] (
[Users_Id] int NOT NULL,
[Features_Id] int NOT NULL
);
GO
-- Creating primary key on [Users_Id], [Features_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [PK_UserFeature]
PRIMARY KEY CLUSTERED ([Users_Id], [Features_Id] ASC);
GO
-- Creating foreign key on [Users_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [FK_UserFeature_User]
FOREIGN KEY ([Users_Id])
REFERENCES [dbo].[Users]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Features_Id] in table 'UserFeature'
ALTER TABLE [dbo].[UserFeature]
ADD CONSTRAINT [FK_UserFeature_Feature]
FOREIGN KEY ([Features_Id])
REFERENCES [dbo].[Features]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_UserFeature_Feature'
CREATE INDEX [IX_FK_UserFeature_Feature]
ON [dbo].[UserFeature]
([Features_Id]);
GO
62 changes: 31 additions & 31 deletions UserRole.sql → sql/UserRole.sql
Original file line number Diff line number Diff line change
@@ -1,32 1,32 @@
-- Creating table 'UserRole'
CREATE TABLE [dbo].[UserRole] (
[Users_Id] int NOT NULL,
[Roles_Id] int NOT NULL
);
GO
-- Creating primary key on [Users_Id], [Roles_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [PK_UserRole]
PRIMARY KEY CLUSTERED ([Users_Id], [Roles_Id] ASC);
GO
-- Creating foreign key on [Users_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [FK_UserRole_User]
FOREIGN KEY ([Users_Id])
REFERENCES [dbo].[Users]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Roles_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [FK_UserRole_Role]
FOREIGN KEY ([Roles_Id])
REFERENCES [dbo].[Roles]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_UserRole_Role'
CREATE INDEX [IX_FK_UserRole_Role]
ON [dbo].[UserRole]
([Roles_Id]);
-- Creating table 'UserRole'
CREATE TABLE [dbo].[UserRole] (
[Users_Id] int NOT NULL,
[Roles_Id] int NOT NULL
);
GO
-- Creating primary key on [Users_Id], [Roles_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [PK_UserRole]
PRIMARY KEY CLUSTERED ([Users_Id], [Roles_Id] ASC);
GO
-- Creating foreign key on [Users_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [FK_UserRole_User]
FOREIGN KEY ([Users_Id])
REFERENCES [dbo].[Users]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating foreign key on [Roles_Id] in table 'UserRole'
ALTER TABLE [dbo].[UserRole]
ADD CONSTRAINT [FK_UserRole_Role]
FOREIGN KEY ([Roles_Id])
REFERENCES [dbo].[Roles]
([Id])
ON DELETE NO ACTION ON UPDATE NO ACTION;
GO
-- Creating non-clustered index for FOREIGN KEY 'FK_UserRole_Role'
CREATE INDEX [IX_FK_UserRole_Role]
ON [dbo].[UserRole]
([Roles_Id]);
GO
Loading

0 comments on commit 0647b8d

Please sign in to comment.