sql_Create_Database_SecureMfaOTP.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
USE [master]
GO
 
/****** Object: Database [SecureMfaOTP] Script Date: 06/11/2017 12:10:45 AM ******/
CREATE DATABASE [SecureMfaOTP]
 CONTAINMENT = NONE
 ON PRIMARY
( NAME = N'SecureMfaOTP', FILENAME = N'D:\DataBases\SecureMfaOTP.mdf' , SIZE = 1048576KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON
( NAME = N'SecureMfaOTP_log', FILENAME = N'L:\Logs\SecureMfaOTP.ldf' , SIZE = 1048576KB , MAXSIZE = 1073741824KB , FILEGROWTH = 10%)
GO
 
USE [SecureMfaOTP]
GO
 
CREATE TABLE [dbo].[Secrets](
    [upn] [varchar](255) NOT NULL,
    [secret] [char](48) NOT NULL,
    [logon] [tinyint] NULL,
    [lastlogon] [datetime] NULL,
    [logoncount] [int] DEFAULT 0 NOT NULL,
    [failedlogoncount] [int] DEFAULT 0 NOT NULL,
        [failedlastlogon] [datetime] NULL,
    [failedcode] [char](6),
    [logonip] [varchar](39),
    [useragent] [varchar](128),
 CONSTRAINT [PK_Secrets] PRIMARY KEY CLUSTERED
(
    [upn] 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].[UsedCodes](
    [upn] [varchar](255) NOT NULL,
    [interval] [bigint] NOT NULL
) ON [PRIMARY]
 
GO