Changeset 3971


Ignore:
Timestamp:
06/28/10 19:06:43 (9 years ago)
Author:
bfarka
Message:

creating unique index for username, email and rolename (#1062)

Location:
branches/HeuristicLab.Services.Authentication Prototype
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DatabaseUtil.cs

    r3970 r3971  
    11using System;
    22using System.Diagnostics;
     3using System.Data.Common;
    34
    45namespace Persistence {
     
    4546      Console.WriteLine("Creating new database...");
    4647      db.CreateDatabase();
     48     
     49      DbCommand command = db.Connection.CreateCommand();
     50      command.CommandText = "CREATE UNIQUE NONCLUSTERED INDEX [IDXRoleName] ON [dbo].[HeuristicLabRole](  [roleName] 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 [PRIMARY]";
     51      command.ExecuteNonQuery();
     52
     53      command.CommandText = "CREATE UNIQUE NONCLUSTERED INDEX [IDXUserName] ON [dbo].[HeuristicLabUser](  [UserName] 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 [PRIMARY]";
     54      command.ExecuteNonQuery();
     55      command.CommandText = "CREATE UNIQUE NONCLUSTERED INDEX [IDXUserEmail] ON [dbo].[HeuristicLabUser](   [Email] 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 [PRIMARY]";
     56      command.ExecuteNonQuery();
    4757      Console.WriteLine("Created new database!");
    4858    }
Note: See TracChangeset for help on using the changeset viewer.